Coder Social home page Coder Social logo

jaimemf / youtube-dl-api-server Goto Github PK

View Code? Open in Web Editor NEW
363.0 363.0 214.0 124 KB

A youtube-dl REST API server

Home Page: https://youtube-dl-api-server.readthedocs.org/

License: The Unlicense

Python 83.28% HTML 3.10% Shell 13.25% Procfile 0.38%

youtube-dl-api-server's Introduction

youtube-dl-api-server

A REST API server for getting the info for videos from different sites, powered by youtube-dl. The installation instructions and the documentation are available at Read the Docs.

About

youtube-dl-api-server is released to the public domain, read the license for more info.

youtube-dl-api-server's People

Contributors

iphoting avatar jaimemf avatar kcchouette avatar oivoodoo avatar r4mos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtube-dl-api-server's Issues

bash: youtube-dl-server: command not found

[root@ns361691 http]# pip install youtube_dl_server
Requirement already satisfied (use --upgrade to upgrade): youtube-dl-server in /usr/lib/python3.3/site-packages
Requirement already satisfied (use --upgrade to upgrade): WebOb in /usr/lib/python3.3/site-packages (from youtube-dl-server)
Requirement already satisfied (use --upgrade to upgrade): Paste in /usr/lib/python3.3/site-packages (from youtube-dl-server)
Requirement already satisfied (use --upgrade to upgrade): webapp2 in /usr/lib/python3.3/site-packages (from youtube-dl-server)
Requirement already satisfied (use --upgrade to upgrade): pyyaml in /usr/lib/python3.3/site-packages (from youtube-dl-server)
Requirement already satisfied (use --upgrade to upgrade): youtube-dl>=2013.12.04 in /usr/lib/python3.3/site-packages (from youtube-dl-server)
Cleaning up...
[root@ns361691 http]# youtube-dl-server
-bash: youtube-dl-server: command not found

Thanks

Outdated youtube-dl

Hi, i see that youtube-dl that api server is using is outdated.
the youtube-dl latest version is "2016.06.23.1" but the api/version shows "2016.05.10"

Youtube is not working with latest version of youtube-dl 2015.01.02 in GAE

Here is some logs for you^^
Thanks in advance!!!

2015-01-02 07:42:02.957 /api/info?url=http://www.youtube.com/watch?v=WZlJf7Rlx84 500 2504ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 module=default version=2014-09-19
221.158.56.146 - - [02/Jan/2015:07:42:02 -0800] "GET /api/info?url=http://www.youtube.com/watch?v=WZlJf7Rlx84 HTTP/1.1" 500 674 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "2015.01.02.ringtube001.appspot.com" ms=2505 cpu_ms=910 cpm_usd=0.000515 app_engine_release=1.9.17 instance=00c61b117c1fe64a3cbb6fda58d48d243065609f
D 2015-01-02 07:42:00.468
[youtube] Setting language
D 2015-01-02 07:42:01.404
[youtube] Confirming age
D 2015-01-02 07:42:01.544
[youtube] WZlJf7Rlx84: Downloading webpage
D 2015-01-02 07:42:01.805
[youtube] WZlJf7Rlx84: Downloading video info webpage
D 2015-01-02 07:42:02.069
[youtube] WZlJf7Rlx84: Extracting video information
D 2015-01-02 07:42:02.699
[youtube] WZlJf7Rlx84: Encrypted signatures detected.
E 2015-01-02 07:42:02.810
ERROR: Signature extraction failed: Traceback (most recent call last):
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/extractor/youtube.py", line 527, in _decrypt_signature
video_id, player_url, s
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/extractor/youtube.py", line 432, in _extract_signature_function
cache_spec = self._downloader.cache.load(u'youtube-sigfuncs', func_id)
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 63, in load
cache_fn = self._get_cache_fn(section, key, dtype)
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 32, in _get_cache_fn
self._get_root_dir(), section, '%s.%s' % (key, dtype))
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 25, in _get_root_dir
return os.path.expanduser(res)
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/posixpath.py", line 268, in expanduser
import pwd
ImportError: No module named pwd
; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
E 2015-01-02 07:42:02.811
Traceback (most recent call last):
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/youtube_dl_server/app.py", line 78, in info
result = get_videos(url)
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/youtube_dl_server/app.py", line 34, in get_videos
res = ydl.extract_info(url, download=False)
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/YoutubeDL.py", line 539, in extract_info
self.report_error(compat_str(de), de.format_traceback())
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/YoutubeDL.py", line 410, in report_error
self.trouble(error_message, tb)
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/YoutubeDL.py", line 380, in trouble
raise DownloadError(message, exc_info)
DownloadError: ERROR: Signature extraction failed: Traceback (most recent call last):
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/extractor/youtube.py", line 527, in _decrypt_signature
video_id, player_url, s
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/extractor/youtube.py", line 432, in _extract_signature_function
cache_spec = self._downloader.cache.load(u'youtube-sigfuncs', func_id)
File "/base/data/home/apps/sringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 63, in load
cache_fn = self._get_cache_fn(section, key, dtype)
File "/base/data/home/apps/s
ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 32, in _get_cache_fn
self._get_root_dir(), section, '%s.%s' % (key, dtype))
File "/base/data/home/apps/s~ringtube001/2014-09-19.378831065144539708/gae/lib/youtube_dl/cache.py", line 25, in _get_root_dir
return os.path.expanduser(res)
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/posixpath.py", line 268, in expanduser
import pwd
ImportError: No module named pwd
; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

Unable to get video info with latest youtube-dl

Here is the url.
http://m.vuclip.com/w?cid=862003300&fid=64348&z=1007&nvar&frm=index.html

vuclip is recently added extractor..
It is working with command line youtube-dl but not with GAE.
Do you have any idea??

with command line youtube-dl
./youtube-dl --verbose "http://m.vuclip.com/w?cid=862003300&fid=64348&z=1007&nvar&frm=index.html"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://m.vuclip.com/w?cid=862003300&fid=64348&z=1007&nvar&frm=index.html']
[debug] Encodings: locale eucKR, fs utf-8, out eucKR, pref eucKR
[debug] youtube-dl version 2014.04.21.6
[debug] Python version 2.7.5 - Darwin-13.1.0-x86_64-i386-64bit
[debug] Proxy map: {}
[VuClip] 862003300: Downloading webpage
[download] Destination: Lindsay Lohans Shocking Revelation-862003300.3gp
[download] 100% of 2.38MiB in 00:15

With GAE
2014-04-29 16:34:36.114 /api/info?url=http%3A%2F%2Fm.vuclip.com%2Fw%3Fcid%3D862003300%26fid%3D64348%26z%3D1007%26nvar%26frm%3Dindex.html 500 350ms 0kb Apache-HttpClient/UNAVAILABLE (java 1.4) module=default version=0-1
175.246.228.144 - - [29/Apr/2014:16:34:36 -0700] "GET /api/info?url=http%3A%2F%2Fm.vuclip.com%2Fw%3Fcid%3D862003300%26fid%3D64348%26z%3D1007%26nvar%26frm%3Dindex.html HTTP/1.1" 500 345 - "Apache-HttpClient/UNAVAILABLE (java 1.4)" "tubedown63720.appspot.com" ms=351 cpu_ms=23 cpm_usd=0.000088 app_engine_release=1.9.3 instance=00c61b117cb5cce5596a8a3aa01fd6b7ba7007
D 2014-04-29 16:34:35.772
[VuClip] 862003300: Downloading webpage
E 2014-04-29 16:34:36.082
ERROR: Unable to extract links; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
E 2014-04-29 16:34:36.083
Traceback (most recent call last):
File "/base/data/home/apps/stubedown63720/0-1.375491019073189814/youtube_dl_server/app.py", line 77, in info
result = get_videos(url)
File "/base/data/home/apps/s
tubedown63720/0-1.375491019073189814/youtube_dl_server/app.py", line 33, in get_videos
res = ydl.extract_info(url, download=False)
File "/base/data/home/apps/stubedown63720/0-1.375491019073189814/gae/lib/youtube_dl/YoutubeDL.py", line 529, in extract_info
self.report_error(compat_str(de), de.format_traceback())
File "/base/data/home/apps/s
tubedown63720/0-1.375491019073189814/gae/lib/youtube_dl/YoutubeDL.py", line 404, in report_error
self.trouble(error_message, tb)
File "/base/data/home/apps/s~tubedown63720/0-1.375491019073189814/gae/lib/youtube_dl/YoutubeDL.py", line 374, in trouble
raise DownloadError(message, exc_info)
DownloadError: ERROR: Unable to extract links; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

HTTP Error 503

Im getting "ERROR: Unable to download webpage: HTTP Error 503: Service Unavailable (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output."

is there any way to add "-4" in executing youtube-dl?

500 Error on GAE

Hey Developers!

Thanks for making such wonderful application. I recently installed youtube-dl-api-server on GAE by using your documents as tutorial but I am receiving 500 server Error. All my libraries are up to date. and also in right directories (as far as i know). but still receiving this error.

PS: Please update youtube-dl in your example GAE application. the old one is not working since yesterday

Force ipv6 on GAE

Google App Engine is using ip address which cannot access VEVO videos and many other signature videos. This problem can be solved by using IPV6. is there any way we can force IPV6 to be used by youtube-dl-api-server?

Downloading external python modules is not working in Windows 7

Since I'm very newbie here, it can be my fault.
However, I cannot solve this problem.

I wanna install youtube-dl-api-server on App Engine.
However, I can not download external python modules in lib.
I did ./devscripts/setup-gae.sh, but it shows some errors

So, would you please tell me how can I complete this downloading to install it on App Engine.

OS of my PC is Windows7 32bit.
I installed Python 2.7x and set PATHs for Python27 directory in C drive.
Here's my log when I ran ./devscripts/setup-gae.sh.

Welcome to Git (version 1.9.2-preview20140411)

Run 'git help git' to display the help index.
Run 'git help ' to display help for specific commands.
Downloading python packages
DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated
. See pypa/pip#906.
Downloading/unpacking youtube-dl>=2014.03.12 (from -r ./gae/gae_requirements.txt
(line 1))
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2f2.7%2fy%2fyoutube_dl%2fyoutub
e_dl-2014.05.19-py2.py3-none-any.whl
Downloading/unpacking flask (from -r ./gae/gae_requirements.txt (line 2))
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2fsource%2ff%2fflask%2fflask-0.
10.1.tar.gz
Running setup.py (path:D:\AppDev\Workspace_ST\youtube_dl_api_test\gae\build\fl
ask\setup.py) egg_info for package flask

warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory

'docs'
warning: no previously-included files matching '.pyo' found under directory
'docs'
warning: no previously-included files matching '
.pyc' found under directory
'tests'
warning: no previously-included files matching '.pyo' found under directory
'tests'
warning: no previously-included files matching '
.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs_build'
no previously-included directories found matching 'docs_themes.git'
Downloading/unpacking Werkzeug>=0.7 (from flask->-r ./gae/gae_requirements.txt (
line 2))
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2fsource%2fw%2fwerkzeug%2fwerkz
eug-0.9.4.tar.gz
Running setup.py (path:D:\AppDev\Workspace_ST\youtube_dl_api_test\gae\build\We
rkzeug\setup.py) egg_info for package Werkzeug

warning: no files found matching '*' under directory 'werkzeug\debug\templat

es'
warning: no files found matching '' under directory 'tests'
warning: no previously-included files matching '
.pyc' found under directory
'docs'
warning: no previously-included files matching '.pyo' found under directory
'docs'
warning: no previously-included files matching '
.pyc' found under directory
'tests'
warning: no previously-included files matching '.pyo' found under directory
'tests'
warning: no previously-included files matching '
.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs_build'
Downloading/unpacking Jinja2>=2.4 (from flask->-r ./gae/gae_requirements.txt (li
ne 2))
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2fsource%2fj%2fjinja2%2fjinja2-
2.7.2.tar.gz
Running setup.py (path:D:\AppDev\Workspace_ST\youtube_dl_api_test\gae\build\Ji
nja2\setup.py) egg_info for package Jinja2

warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'do

cs_build'
warning: no previously-included files matching '.pyc' found under directory
'jinja2'
warning: no previously-included files matching '
.pyc' found under directory
'docs'
warning: no previously-included files matching '.pyo' found under directory
'jinja2'
warning: no previously-included files matching '
.pyo' found under directory
'docs'
Downloading/unpacking itsdangerous>=0.21 (from flask->-r ./gae/gae_requirements.
txt (line 2))
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2fsource%2fi%2fitsdangerous%2fi
tsdangerous-0.24.tar.gz
Running setup.py (path:D:\AppDev\Workspace_ST\youtube_dl_api_test\gae\build\it
sdangerous\setup.py) egg_info for package itsdangerous

warning: no previously-included files matching '*' found under directory 'do

cs_build'
Downloading/unpacking markupsafe (from Jinja2>=2.4->flask->-r ./gae/gae_requirem
ents.txt (line 2))
Downloading MarkupSafe-0.23.tar.gz
Storing download in cache at d:\appdev\workspace_st\youtube_dl_api_test\gae\tm
p\cache\https%3a%2f%2fpypi.python.org%2fpackages%2fsource%2fm%2fmarkupsafe%2fmar
kupsafe-0.23.tar.gz
Running setup.py (path:D:\AppDev\Workspace_ST\youtube_dl_api_test\gae\build\ma
rkupsafe\setup.py) egg_info for package markupsafe

Successfully downloaded youtube-dl flask Werkzeug Jinja2 itsdangerous markupsafe

Copying python packages to ./gae/lib
Patching youtube_dl
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory
sed: can't read s/import fcntl/()# Removed fcntl import/g: No such file or direc
tory

.......

Please give me answer.
Thank you.

GAE

After deploying to GAE it works fine but for each request the trace says
"This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."

Update

Thanks, its a great app, I would like to be able to update the app with the latest yt-dl updates. Please advice, many thanks.

SSL: CERTIFICATE_VERIFY_FAILED

Hi,
I downloaded the project to my Windows 7 PC (python 3.3). I tried to run the server on my PC. Got the following error:

// 20151206212422
// http://localhost:9191/api/info?url=http://www.ted.com/talks/dan_dennett_on_our_consciousness.html&flatten=False

{
"error": "ERROR: Failed to download m3u8 information: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:547)'),))"
}

Is there a workaround for testing purpose?

Error en request a la API

Constantemente realizo request a la API desde este sitio http://rafaelbecks.github.io/cthulhu-downloader/

Desde hace algunos dรญas estoy recibiendo el siguiente error

Failed to load resource: the server responded with a status of 500 (Internal Server Error) https://youtube-dl.appspot.com/api/info?url=alt-j%20hunger%20of%20the%20pine
XMLHttpRequest cannot load https://youtube-dl.appspot.com/api/info?url=https://www.youtube.com/watch?v=k_EhHcZzUoE. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://rafaelbecks.github.io' is therefore not allowed access.

Error 503:
Over Quota

This application is temporarily over its serving quota. Please try again later.

Alguna informaciรณn sobre ello?

Gracias anticipadas

Schedule the download

Is it possible to schedule a download to a particular time range ? Like a queue of videos to be downloaded at a specific time range ?

Error: Server Error

I have create a new issue here.

Im getting this in my app engine and i dont know how to get round of this error cause im a new user app engine.

The server encountered an error and could not complete your request.
Please try again in 30 seconds.

I have read this in your documentation.

It needs some external python modules in lib, you can download them by running ./devscripts/setup-gae.sh (it requires pip and virtualenv).

but i dont know how to i run ./devscripts/setup-gae.sh

"not all arguments converted during string formatting" on GAE

I get the following trace on AppEngine when trying to use MixCloud converter. The other converters I tried seem to be fine. I am not sure what causes that issue:

Exception on /api/info [GET] Traceback (most recent call last): File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/youtube_dl_server/app.py", line 60, in wrapper response = f(*args, **kargs) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/youtube_dl_server/app.py", line 78, in info result = get_videos(url) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/youtube_dl_server/app.py", line 34, in get_videos res = ydl.extract_info(url, download=False) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/youtube_dl/YoutubeDL.py", line 524, in extract_info ie_result = ie.extract(url) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/youtube_dl/extractor/common.py", line 193, in extract return self._real_extract(url) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/youtube_dl/extractor/mixcloud.py", line 64, in _real_extract final_song_url = self._get_url(track_id, template_url) File "/base/data/home/apps/s~youtube-dl-api/0-1.379438296626853997/gae/lib/youtube_dl/extractor/mixcloud.py", line 39, in _get_url url = template_url % i TypeError: not all arguments converted during string formatting

Just get first video of a playlist

Hi, I deployed this app to GAE, it's working fine but somethings wrong while trying to get links of a playlist (youtube)

http://since....appspot.com/api/?url=http://www.youtube.com/watch?v=CAP-Xj4Fz18&list=FLm7zmYIDWXpE5aIuXLYlpvA

You can try my deployment by the url above. It returns first video of playlist only. It's weird!! I know since your deployment at:

http://youtube-dl.appspot.com/api/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCAP-Xj4Fz18%26list%3DFLm7zmYIDWXpE5aIuXLYlpvA

is working fine.
Could you have a look and tell me the reason?
Thank you very much! ๐Ÿ‘

ERROR: "token" parameter not in video info for unknown reason

For every YouTube URL that I try to retrieve the JSON Data, I get the following message. I have also tried the same YouTube URLs on http://jaimemf.github.io/youtube-dl-web/ and an error message is returned. I have tried using YouTube-DL from the command line and I can download the video so I am guessing something is going wrong with the api-server. Unfortunately I am unsure what as I'm new to using this project.

{
  "error": "ERROR: VLAXxAoWAok: \"token\" parameter not in video info for unknown reason; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output."
}

EDIT: The most up to date version of YouTube-DL is being used.

GAE error: AttributeError: 'module' object has no attribute 'Popen'

My setup OSX 10.9.5.
I ran ./devscripts/setup-gae.sh

Downloading python packages
Downloading/unpacking youtube-dl>=2014.03.12 (from -r ./gae/gae_requirements.txt (line 1))
  Using download cache from ./gae/tmp/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fy%2Fyoutube_dl%2Fyoutube_dl-2015.05.04.tar.gz
  Running setup.py egg_info for package youtube-dl

Requirement already up-to-date: flask in /Library/Python/2.7/site-packages (from -r ./gae/gae_requirements.txt (line 2))
Downloading/unpacking Werkzeug>=0.7 from https://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.10.4.tar.gz#md5=66a488e0ac50a9ec326fe020b3083450 (from flask->-r ./gae/gae_requirements.txt (line 2))
  Using download cache from ./gae/tmp/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FW%2FWerkzeug%2FWerkzeug-0.10.4.tar.gz
  Running setup.py egg_info for package Werkzeug

    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/_themes'
    warning: no previously-included files matching '*.py[cdo]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.pyd' found anywhere in distribution
Requirement already up-to-date: Jinja2>=2.4 in /Library/Python/2.7/site-packages (from flask->-r ./gae/gae_requirements.txt (line 2))
Requirement already up-to-date: itsdangerous>=0.21 in /Library/Python/2.7/site-packages (from flask->-r ./gae/gae_requirements.txt (line 2))
Requirement already up-to-date: markupsafe in /Library/Python/2.7/site-packages (from Jinja2>=2.4->flask->-r ./gae/gae_requirements.txt (line 2))
Successfully downloaded youtube-dl Werkzeug
Copying python packages to ./gae/lib
cp: ./gae/build/flask/flask: No such file or directory
cp: ./gae/build/itsdangerous/itsdangerous.py: No such file or directory
Patching youtube_dl

I got a bunch of import errors for flask and itsdangerous and I had to separately download flask and itsdangerous and copy them into ./gae/lib/ before it sorta worked.

When I tried to test the /api/info endpoint, I got a server 500 error. The stack trace:

ERROR    2015-05-07 04:49:16,481 app.py:1423] Exception on /api/info [GET]
Traceback (most recent call last):
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/youtube_dl_server/app.py", line 60, in wrapper
    response = f(*args, **kargs)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/youtube_dl_server/app.py", line 78, in info
    result = get_videos(url)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/youtube_dl_server/app.py", line 34, in get_videos
    res = ydl.extract_info(url, download=False)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/YoutubeDL.py", line 661, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/YoutubeDL.py", line 707, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/YoutubeDL.py", line 1089, in process_video_result
    if info_dict['extractor'] in ['youtube', 'ted'] and FFmpegMergerPP(self).available:
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/postprocessor/ffmpeg.py", line 34, in __init__
    self._determine_executables()
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/postprocessor/ffmpeg.py", line 90, in _determine_executables
    (p, get_exe_version(p, args=['-version'])) for p in programs)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/postprocessor/ffmpeg.py", line 90, in <genexpr>
    (p, get_exe_version(p, args=['-version'])) for p in programs)
  File "/Users/ping/PycharmProjects/youtube-dl-api-server/gae/lib/youtube_dl/utils.py", line 1382, in get_exe_version
    out, _ = subprocess.Popen(
AttributeError: 'module' object has no attribute 'Popen'

Any idea what's wrong? Same error on the local devserver and deployed on GAE.

Audio Support

I wanted to ask if their is any Plans for Audio support , and if i can work on it then make a pull request ?
Thanks

Setup file

Add application.cfg and index.html as data files in setup file

youtube-dl-web Install?

how do i setup my own youtube-dl-api-server ? i need a more detailed instruction i am running a vps plesk 12 centos 6.9. do i need to create a subdomain and host it on this?

Support # in the URL

Seems not taking # in the URL.
commandline youtube-dl is O.K with some changed for blinkx

_VALID_URL = r'^(?:https?://(?:www.)blinkx.com/#*ce/|blinkx:)(?P[^?]+)'

Here is some error log for GAE

http://xxxxxx.appspot.com/api/?url=http://www.blinkx.com/#ce/8aQUy7GVFYgFzpKhT0oqsilwOGFRVXk3R1ZGWWdGenBLaFQwb3FzaWx3OGFRVXk3R1ZGWWdGenB

Log from GAE

2013-12-21 05:13:39.180 /api/?url=http://www.blinkx.com/ 200 464ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 module=default version=alpha-3-4
221.158.56.138 - - [21/Dec/2013:05:13:39 -0800] "GET /api/?url=http://www.blinkx.com/ HTTP/1.1" 200 321 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" "tubedown63772.appspot.com" ms=465 cpu_ms=47 cpm_usd=0.000099 app_engine_release=1.8.8 instance=00c61b117c281cde63f98bd4668e70a5a95bfb60
E 2013-12-21 05:13:38.936
WARNING: Falling back on generic information extractor.
D 2013-12-21 05:13:38.937
[generic] : Downloading webpage
D 2013-12-21 05:13:39.173
[generic] : Extracting information
E 2013-12-21 05:13:39.177
ERROR: Unsupported URL: http://www.blinkx.com/; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
E 2013-12-21 05:13:39.179
Traceback (most recent call last):
File "/base/data/home/apps/stubedown63772/alpha-3-4.372489474374418417/youtube_dl_server/API/APIresponder.py", line 73, in get_response
vids = videos(url)
File "/base/data/home/apps/s
tubedown63772/alpha-3-4.372489474374418417/youtube_dl_server/API/APIresponder.py", line 49, in videos
res = ydl.extract_info(url, download=False)
File "/base/data/home/apps/stubedown63772/alpha-3-4.372489474374418417/lib/youtube_dl/YoutubeDL.py", line 496, in extract_info
self.report_error(compat_str(de), de.format_traceback())
File "/base/data/home/apps/s
tubedown63772/alpha-3-4.372489474374418417/lib/youtube_dl/YoutubeDL.py", line 368, in report_error
self.trouble(error_message, tb)
File "/base/data/home/apps/s~tubedown63772/alpha-3-4.372489474374418417/lib/youtube_dl/YoutubeDL.py", line 343, in trouble
raise DownloadError(message, exc_info)
DownloadError: ERROR: Unsupported URL: http://www.blinkx.com/; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

Error in youtube-dl

{
"error": "ERROR: Signature extraction failed: Traceback (most recent call last):\n File "/app/.heroku/python/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1070, in _decrypt_signature\n video_id, player_url, s\n File "/app/.heroku/python/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 958, in _extract_signature_function\n raise ExtractorError('Cannot identify player %r' % player_url)\nExtractorError: Cannot identify player u'https://www.youtube.com/yts/jsbin/player-vfl4Xq3l4/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.\n (caused by ExtractorError(u"Cannot identify player u'https://www.youtube.com/yts/jsbin/player-vfl4Xq3l4/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output."
}

error failed

for most of the videos it gives error saying {
"error": "ERROR: Signature extraction failed: Traceback (most recent call last):\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/extractor/youtube.py", line 1005, in _decrypt_signature\n video_id, player_url, s\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/extractor/youtube.py", line 919, in _extract_signature_function\n errnote='Download of %s failed' % player_url)\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/extractor/common.py", line 516, in _download_webpage\n res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/extractor/common.py", line 423, in _download_webpage_handle\n urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/extractor/common.py", line 403, in _request_webpage\n return self._downloader.urlopen(url_or_request)\n File "/base/data/home/apps/syoutube-dl/0-3.396513968021508387/gae/lib/youtube_dl/YoutubeDL.py", line 2001, in urlopen\n return self._opener.open(req, timeout=self._socket_timeout)\n File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 396, in open\n protocol = req.get_type()\n File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib2.py", line 258, in get_type\n raise ValueError, "unknown url type: %s" % self.__original\nValueError: unknown url type: /yts/jsbin/player-en_US-vflqOi6vK/base.js\n (caused by ValueError(u'unknown url type: /yts/jsbin/player-en_US-vflqOi6vK/base.js',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output."
}

where as same video work on youtube-dl may be the code inside has to be updated with youtube-dl could you please update the same

Support for user-defineable params?

I've noticed a problem with using the /api/info endpoint for channels, such as https://www.youtube.com/user/Youtube/videos.
The endpoint will attempt to lookup all of the videos in the channel which can take a very long time and likely timeout eventually.

This can be mitigated by defining the playlistend param, but there is no way to do this currently.
I patched my local copy of app.py to support a small set of user-defined params, but I'm not sure if this a good/pythonic way of doing it.

def info():
    url = request.args['url']
    # list of user defined params
    supported_params = {'playliststart': 'int', 'playlistend': 'int', 'playlist_items': 'int', 'matchtitle': 'str', 'rejecttitle': 'str'}
    params = {}
    for p in supported_params:
        if p in request.args:
            if supported_params[p] == 'int':
                params[p] = int(request.args[p])
            else:
                params[p] = request.args[p]
    errors = (youtube_dl.utils.DownloadError, youtube_dl.utils.ExtractorError)
    try:
        result = get_videos(url, params)    # modified
        key = 'info'

    # ... <snip>


def get_videos(url, params=None):
    '''
    Get a list with a dict for every video founded
    '''
    ydl_params = {
        'format': 'best',
        'cachedir': False,
        'logger': app.logger.getChild('youtube-dl'),
    }
    # merge user params if provided
    if params:
        ydl_params.update(params)
    ydl = SimpleYDL(ydl_params)
    res = ydl.extract_info(url, download=False)
    return res

Unable to access video when deployed in heroku.

First, thank you for made useful app like this.

I deployed this repository in my heroku server with no change.
And I request to url like below, but video urls in response is return 403 forbidon.

http://traktrax-video-api.herokuapp.com/api/info?url=https://www.youtube.com/watch?v=OPf0YbXqDm0

However, response of same request to your example server is return right video.

http://youtube-dl.appspot.com/api/info?url=https://www.youtube.com/watch?v=OPf0YbXqDm0

What is difference of between servers?

I check issue for similar status, but I couldn't find solution.
#3

Is master branch deployed on the youtube-dl.appspot.com?

Thank you :)

Can't install youtube-dl-serveur

I try to install youtube-dl-server:

 [root@ns361691 ~]# pip install --pre youtube_dl_server
Downloading/unpacking youtube-dl-server
  Downloading youtube_dl_server-alpha.3.5.tar.gz
  Running setup.py (path:/tmp/pip_build_root/youtube-dl-server/setup.py) egg_info for package youtube-dl-server

Downloading/unpacking WebOb (from youtube-dl-server)
  Downloading WebOb-1.3.1.tar.gz (198kB): 198kB downloaded
  Running setup.py (path:/tmp/pip_build_root/WebOb/setup.py) egg_info for package WebOb

```
no previously-included directories found matching '*.pyc'
no previously-included directories found matching '*.pyo'
```

Downloading/unpacking Paste (from youtube-dl-server)
  Downloading Paste-1.7.5.1.tar.gz (523kB): 523kB downloaded
  Running setup.py (path:/tmp/pip_build_root/Paste/setup.py) egg_info for package Paste

```
warning: no previously-included files matching '*' found under directory 'docs/_build/_sources'
```

Downloading/unpacking webapp2 (from youtube-dl-server)
  Downloading webapp2-2.5.2.tar.gz (191kB): 191kB downloaded
  Running setup.py (path:/tmp/pip_build_root/webapp2/setup.py) egg_info for package webapp2

```
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'webapp2_extras'
```

Downloading/unpacking pyyaml (from youtube-dl-server)
  Downloading PyYAML-3.10.tar.gz (241kB): 241kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pyyaml/setup.py) egg_info for package pyyaml

Downloading/unpacking youtube-dl>=2013.12.04 (from youtube-dl-server)
  Downloading youtube_dl-2014.02.21.1.tar.gz (306kB): 306kB downloaded
  Running setup.py (path:/tmp/pip_build_root/youtube-dl/setup.py) egg_info for package youtube-dl

Installing collected packages: youtube-dl-server, WebOb, Paste, webapp2, pyyaml, youtube-dl
  Running setup.py install for youtube-dl-server
    changing mode of build/scripts-3.3/youtube-dl-server from 644 to 755

```
changing mode of /usr/bin/youtube-dl-server to 755
```

  Running setup.py install for WebOb

```
no previously-included directories found matching '*.pyc'
no previously-included directories found matching '*.pyo'
```

  Running setup.py install for Paste
    Skipping installation of /usr/lib/python3.3/site-packages/paste/**init**.py (namespace package)
      File "/usr/lib/python3.3/site-packages/paste/fileapp.py", line 126
        except HTTPBadRequest, exce:
                             ^
    SyntaxError: invalid syntax

```
  File "/usr/lib/python3.3/site-packages/paste/flup_session.py", line 84
    except httpexceptions.HTTPException, e:
                                       ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/urlparser.py", line 371
    except (OSError, IOError), e:
                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/reloader.py", line 101
    except (AttributeError, ImportError), exc:
                                        ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/cgiapp.py", line 257
    except OSError, e:
                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/httpexceptions.py", line 634
    except HTTPException, exc:
                        ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/registry.py", line 380
    except Exception, e:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/wsgilib.py", line 135
    raise got_exc[0], got_exc[1], got_exc[2]
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/cascade.py", line 126
    except self.catch_exceptions, e:
                                ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/modpython.py", line 179
    raise exc_info[0], exc_info[1], exc_info[2]
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/recursive.py", line 85
    except ForwardRequestException, e:
                                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/httpserver.py", line 156
    raise exc_info[0], exc_info[1], exc_info[2]
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/fixture.py", line 449
    def _make_response(self, (status, headers, body, errors), total_time):
                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/errordocument.py", line 87
    except RecursionLoop, e:
                        ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/transaction.py", line 119
    print bing, time
             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/wsgiwrappers.py", line 448
    raise IOError, "This %s instance's content is not writable: (content " \
                 ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/watchthreads.py", line 293
    except Exception, e:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/debugapp.py", line 44
    print "%s of %s remaining" % (remaining, total)
                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/testserver.py", line 50
    print "\nWARNING: WSGIRegressionServer timeout exceeded\n"
                                                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/profile.py", line 203
    raise exc_info[0], exc_info[1], exc_info[2]
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/fsdiff.py", line 256
    print 'Could not find %r in:' % s
                                ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/debug/doctest_webapp.py", line 33
    print data
             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/auth/auth_tkt.py", line 146
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/auth/cookie.py", line 65
    return reduce((lambda a, (b, c): a.replace(b, c)), sublist, str(s))
                             ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/evalexception/evalcontext.py", line 37
    exec code in self.namespace, self.globs
            ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/evalexception/middleware.py", line 149
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/PySourceColor.py", line 670
    print doc % (__version__)
            ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/import_string.py", line 50
    except ImportError, e:
                      ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/doctest24.py", line 359
    raise TypeError, 'Expected a module: %r' % module
                   ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/multidict.py", line 142
    raise TypeError, "pop expected at most 2 arguments, got "\
                   ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/template.py", line 210
    raise exc_info[0], e, exc_info[2]
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/ip4.py", line 85
    if len(tuple) <> 2:
                   ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/subprocess24.py", line 682
    if (GetVersion() >= 0x80000000L or
                                  ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/intset.py", line 60
    return not isinstance(value,_Infinity) or self._neg <> value._neg
                                                         ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/UserDict24.py", line 122
    raise TypeError, "pop expected at most 2 arguments, got "\
                   ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/string24.py", line 70
    raise ValueError, "maketrans arguments must have same length"
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/util/scgiserver.py", line 93
    raise exc_info[0], exc_info[1], exc_info[2]
                     ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/exceptions/formatter.py", line 223
    except Exception, e:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/paste/exceptions/serial_number_generator.py", line 59
    raise ValueError, (
                    ^
SyntaxError: invalid syntax


warning: no previously-included files matching '*' found under directory 'docs/_build/_sources'
Installing /usr/lib/python3.3/site-packages/Paste-1.7.5.1-py3.3-nspkg.pth
```

  Running setup.py install for webapp2

```
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'webapp2_extras'
  File "/usr/lib/python3.3/site-packages/webapp2_extras/securecookie.py", line 87
    except Exception, e:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib/python3.3/site-packages/webapp2.py", line 571
    except Exception, e:
                    ^
SyntaxError: invalid syntax
```

  Running setup.py install for pyyaml
    checking if libyaml is compilable
    gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -I/usr/include/python3.3m -c build/temp.linux-x86_64-3.3/check_libyaml.c -o build/temp.linux-x86_64-3.3/check_libyaml.o
    build/temp.linux-x86_64-3.3/check_libyaml.c:2:18: fatal error: yaml.h: No such file or directory
     #include 
                      ^
    compilation terminated.

```
libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
 specify the option --include-dirs or uncomment and
 modify the parameter include_dirs in setup.cfg)
```

  Running setup.py install for youtube-dl

```
Installing youtube-dl script to /usr/bin
```

Successfully installed youtube-dl-server WebOb Paste webapp2 pyyaml youtube-dl
Cleaning up...
[root@ns361691 ~]# youtube-dl-server
Traceback (most recent call last):
  File "/usr/bin/youtube-dl-server", line 3, in 
    import youtube_dl_server
  File "/usr/lib/python3.3/site-packages/youtube_dl_server/**init**.py", line 1, in 
    from .server import main, setup
  File "/usr/lib/python3.3/site-packages/youtube_dl_server/server.py", line 1, in 
    from paste import httpserver
  File "/usr/lib/python3.3/site-packages/paste/httpserver.py", line 156
    raise exc_info[0], exc_info[1], exc_info[2]
                     ^
SyntaxError: invalid syntax 

Thanks

Video not available

With some videos I get:

{"error": "ERROR: YouTube said: The uploader has not made this video available in your country."}.

Thank you

Some extractors failing on GAE

Unfortunately I faced a limitation on some of the extractors on GAE. For example the Mixcloud extractor fails with the following stack trace:

WARNING 2014-08-14 01:50:24,452 urlfetch_stub.py:482] Stripped prohibited headers from URLFetch request: ['Host']
WARNING 2014-08-14 01:50:24,523 urlfetch_stub.py:482] Stripped prohibited headers from URLFetch request: ['Host']
WARNING 2014-08-14 01:50:24,565 urlfetch_stub.py:482] Stripped prohibited headers from URLFetch request: ['Host']

and then the request just times out. On the other hand if used on non GAE installation or the command line youtube-dl utility it is working fine. Is there any easy way to get around this limitation on GAE?

Error from youtube-dl version 2014.09.14

2014.09.12 is O.K

Here is the error log.

2014-09-19 23:56:56.230 /api/info?url=http://www.youtube.com/watch?v=pKDkB9FKzs4 500 2758ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2 module=default version=2014-09-19
221.158.56.146 - - [19/Sep/2014:23:56:56 -0700] "GET /api/info?url=http://www.youtube.com/watch?v=pKDkB9FKzs4 HTTP/1.1" 500 264 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2" "ringtube001.appspot.com" ms=2759 cpu_ms=2383 cpm_usd=0.000400 loading_request=1 app_engine_release=1.9.11 instance=00c61b117ccce65936ec98a44aaf20cf5fbce039
D 2014-09-19 23:56:54.894
[youtube] Setting language
D 2014-09-19 23:56:55.586
[youtube] Confirming age
D 2014-09-19 23:56:55.679
[youtube] pKDkB9FKzs4: Downloading webpage
D 2014-09-19 23:56:55.862
[youtube] pKDkB9FKzs4: Downloading video info webpage
D 2014-09-19 23:56:55.980
[youtube] pKDkB9FKzs4: Extracting video information
E 2014-09-19 23:56:56.221
Exception on /api/info [GET]
Traceback (most recent call last):
File "/base/data/home/apps/sringtube001/2014-09-19.378815092597542924/gae/lib/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/base/data/home/apps/s
ringtube001/2014-09-19.378815092597542924/gae/lib/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/base/data/home/apps/sringtube001/2014-09-19.378815092597542924/gae/lib/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/base/data/home/apps/s
ringtube001/2014-09-19.378815092597542924/gae/lib/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/base/data/home/apps/sringtube001/2014-09-19.378815092597542924/gae/lib/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/base/data/home/apps/s
ringtube001/2014-09-19.378815092597542924/youtube_dl_server/app.py", line 59, in wrapper
response = f(_args, *_kargs)
File "/base/data/home/apps/s~ringtube001/2014-09-19.378815092597542924/youtube_dl_server/app.py", line 84, in info
'youtube-dl.version': youtube_dl.version,
AttributeError: 'module' object has no attribute 'version'
I 2014-09-19 23:56:56.230
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

net::ERR_CONNECTION_REFUSED using youtube-web with localhost server

My steps:

  • New Ubuntu 12.04.4 Vagrant dev box (eg vagrant up, vagrant ssh)

$ "sudo apt-get update && sudo apt-get install git python-pip -y"
$ "git clone https://github.com/jaimeMF/youtube-dl-api-server.git"
$ "cd youtube-dl-api-server/"
Per the docs here https://youtube-dl-api-server.readthedocs.org/en/latest/install.html I run:
$ "sudo pip install -r requirements.txt"
Output:

Downloading/unpacking youtube-dl>=2014.03.12 (from -r requirements.txt (line 1))
  Downloading youtube_dl-2014.06.19.tar.gz (384Kb): 384Kb downloaded
  Running setup.py egg_info for package youtube-dl

Downloading/unpacking flask (from -r requirements.txt (line 2))
  Downloading Flask-0.10.1.tar.gz (544Kb): 544Kb downloaded
  Running setup.py egg_info for package flask

    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/_themes/.git'
Downloading/unpacking Werkzeug>=0.7 (from flask->-r requirements.txt (line 2))
  Downloading Werkzeug-0.9.6.tar.gz (1.1Mb): 1.1Mb downloaded
  Running setup.py egg_info for package Werkzeug

    warning: no files found matching '*' under directory 'werkzeug/debug/templates'
    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking Jinja2>=2.4 (from flask->-r requirements.txt (line 2))
  Downloading Jinja2-2.7.3.tar.gz (378Kb): 378Kb downloaded
  Running setup.py egg_info for package Jinja2

    warning: no files found matching '*' under directory 'custom_fixers'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
Downloading/unpacking itsdangerous>=0.21 (from flask->-r requirements.txt (line 2))
  Downloading itsdangerous-0.24.tar.gz (46Kb): 46Kb downloaded
  Running setup.py egg_info for package itsdangerous

    warning: no previously-included files matching '*' found under directory 'docs/_build'
Downloading/unpacking markupsafe (from Jinja2>=2.4->flask->-r requirements.txt (line 2))
  Downloading MarkupSafe-0.23.tar.gz
  Running setup.py egg_info for package markupsafe

Installing collected packages: youtube-dl, flask, Werkzeug, Jinja2, itsdangerous, markupsafe
  Running setup.py install for youtube-dl

    Installing youtube-dl script to /usr/local/bin
  Running setup.py install for flask

    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/_themes/.git'
  Running setup.py install for Werkzeug

    warning: no files found matching '*' under directory 'werkzeug/debug/templates'
    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
  Running setup.py install for Jinja2

    warning: no files found matching '*' under directory 'custom_fixers'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
  Running setup.py install for itsdangerous

    warning: no previously-included files matching '*' found under directory 'docs/_build'
  Running setup.py install for markupsafe

    building 'markupsafe._speedups' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c markupsafe/_speedups.c -o build/temp.linux-x86_64-2.7/markupsafe/_speedups.o
    markupsafe/_speedups.c:12:20: fatal error: Python.h: No such file or directory
    compilation terminated.
========================================================================
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Failure information, if any, is above.
    Retrying the build without the C extension now.
==========================================================================
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Plain-Python installation succeeded.
==========================================================================
Successfully installed youtube-dl flask Werkzeug Jinja2 itsdangerous markupsafe
Cleaning up...

then I run:
$ "python -m youtube_dl_server"
* Running on http://localhost:9191/

Now when I point something like youtube-dl-web (https://github.com/jaimeMF/youtube-dl-web) to my localserver (hosted on same server as youtube-dl-api-server) and search for a youtube video in Chrome console I get:

GET http://localhost:9191/api/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dk-xSP_T0VqU net::ERR_CONNECTION_REFUSED jquery-latest.js:8706
send jquery-latest.js:8706
jQuery.extend.ajax jquery-latest.js:8136
jQuery.(anonymous function) jquery-latest.js:8282
jQuery.extend.getJSON jquery-latest.js:8265
BaseVideoInfo.get_info VideoInfo.js:14
processVideosURL processURL.js:37
processURLform processURL.js:43
onclick (index):47

Have you encountered this? The installation instructions are kind of .... sparse. Can you suggest what I may be doing wrong?

Thank you for your time!

Update supported websites.

You should update the supported websites. Right now your web interface does not support latest websites which are supported by youtube-dl. I hope you will add support for them ๐Ÿ‘

The test server always returns "503 Over Quota"

For example:

$ curl http://youtube-dl.appspot.com/

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>503 Over Quota</title>
<style><!--
body {font-family: arial,sans-serif}
div.nav {margin-top: 1ex}
div.nav A {font-size: 10pt; font-family: arial,sans-serif}
span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}
div.nav A,span.big {font-size: 12pt; color: #0000cc}
div.nav A {font-size: 10pt; color: black}
A.l:link {color: #6f6f6f}
A.u:link {color: green}
//--></style>

</head>
<body text=#000000 bgcolor=#ffffff>
<table border=0 cellpadding=2 cellspacing=0 width=100%>
<tr><td bgcolor=#3366cc><font face=arial,sans-serif color=#ffffff><b>Error</b></td></tr>
<tr><td>&nbsp;</td></tr></table>
<blockquote>
<H1>Over Quota</H1>
This application is temporarily over its serving quota.  Please try again later.

<p>
</blockquote>
<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#3366cc><img alt="" width=1 height=4></td></tr></table>
</body></html>

Seems the test server is too popular.

Support for subtitles?

Are subtitles supported?
For example https://www.youtube.com/watch?v=XJGiS83eQLk has subtitles

$ youtube-dl --skip-download --write-sub "https://www.youtube.com/watch?v=XJGiS83eQLk"
[youtube] XJGiS83eQLk: Downloading webpage
[youtube] XJGiS83eQLk: Extracting video information
[youtube] XJGiS83eQLk: Downloading DASH manifest
[info] Writing video subtitles to: Creating Subtitles and Closed Captions on Your Youtube Videos-XJGiS83eQLk.en.srt

but with the api, it returns

      "requested_subtitles": null, 
      "subtitles": {}, 

Also, any chance of passing in user params for subtitles?

Update

What files are needed to be replaced and where for using latest version of youtube-dl, also can we just copy-paste them here or does it need to be modified for use with this ?

403 Error on video url after deploying on Heroku

I deployed the API Server on Heroku here.
It is up and running. I am able to get the info dictionary of the video at /api/info but I cannot access the video-urls generated (I am getting a 403 Forbidden error). This is probabaly due to the IP constraint that extracting extracting link and downloading it must be done from the same IP.

Here is a example:
Consider the video - https://www.youtube.com/watch?v=rYEDA3JcQqw
Its info dictionary generated by the Heroku server is - https://youtube-dl-backend1.herokuapp.com/api/info?url=https://www.youtube.com/watch?v=rYEDA3JcQqw
Link for the audio of the video is here, which is inaccessible and throws a 403 Forbidden status code.

I am curious is there any way to avoid this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.