jaimeMF / youtube-dl-api-server

A youtube-dl REST API server
https://youtube-dl-api-server.readthedocs.org/
The Unlicense
364 stars 214 forks source link

Does this support all options of youtube-dl shell command? #8

Closed ksy5662 closed 10 years ago

ksy5662 commented 10 years ago

Does this support all options of youtube-dl shell command?

I need -g and -F option for youtube-dl.

Many thanks for your project. :)

jaimeMF commented 10 years ago

There's (probably) no need for them. Getting the url (-g) is really easy, it's the url field of the the video dictionary. For -F, see for example http://youtube-dl.appspot.com/api/?url=http://vimeo.com/68122855 and look into the formats field. I think that's all you need. If you have any question, just ask.

ksy5662 commented 10 years ago

Thanks jaimeMF for your kind explanation!

Seems only have one format for YouTube. Is it correct?

{"url": "http://www.youtube.com/watch?v=LusD_PBpq5E", "youtube-dl.version": "2013.12.04", "videos": [{"upload_date": "20131209", "extractor": "youtube", "duration": "30", "player_url": null, "id": "LusD_PBpq5E", "view_count": 800, "playlist": null, "title": "\uc2e0\ub3d9\uc758 \uc2ec\uc2ec\ud0c0\ud30c - DICKPUNKS Kim Hyun-woo - Gray, \ub515\ud391\uc2a4 \uae40\ud604\uc6b0 - \ud68c\uc0c9(\uc1fc\ub9ac) \ud55c\uc18c\uc808 \ub77c\uc774\ube0c 20131207", "playlist_index": null, "age_limit": 0, "thumbnail": "https://i1.ytimg.com/vi/LusD_PBpq5E/maxresdefault.jpg", "description": "\"SimSimTaPa\" is a famous Korean radio program of MBC, started since 2005.\nIts MC is Shin Dong of Super Junior who is idol dancing group from Korea.\nThe name SimSimTapa can be translated to \"Breaking the Boredom\" in Korean.\n\nNow you can also \"WATCH\" the Radio (not just listen to it).\nWe offer you this \"Visible Radio\" here at this MBC K-POP channel!\n\nIn addition, you can listen to MBC Radio easily by downloading \"miniMBC\"\nclick here to download \"miniMBC\"\nhttp://www.imbc.com/broad/radio/minimbc/setup_pc/index.html\n\nIf you want to watch our program by mobile, please refer to this link below\nhttp://www.imbc.com/broad/radio/minimbc/setup_app/index.html\n\nPlease be aware that \"Visible Radio\" is not available all the time.\nYou will only see the play button when the Radio's on air.\n\n20131207 \uc2e0\ub3d9\uc758 \uc2ec\uc2ec\ud0c0\ud30c '\ub9c8\uc774\ub2e4\uc2a4\uc758 \uc2e0' \ubcf4\uc774\ub294 \ub77c\ub514\uc624 with \ub515\ud391\uc2a4(DICKPUNKS)\n\n\ub515\ud391\uc2a4 \uae40\ud604\uc6b0 - \ud68c\uc0c9(\uc1fc\ub9ac) \ud55c\uc18c\uc808 \ub77c\uc774\ube0c\nDICKPUNKS Kim Hyun-woo - Gray (Live.)", "format": "22 - 1280x720", "uploader": "MBCkpop", "format_id": "22", "uploader_id": "MBCkpop", "subtitles": null, "url": "http://r4---sn-a8au-p5qz.googlevideo.com/videoplayback?key=yt5&ip=8.35.201.53&mv=u&fexp=931319%2C935501%2C916611%2C919116%2C936912%2C936910%2C923305%2C936913%2C907231%2C907240%2C921090&sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&ratebypass=yes&ipbits=0&itag=22&mt=1386599667&upn=dI0tbBxzDws&id=2eeb03fcf069ab91&ms=au&source=youtube&sver=3&expire=1386622848&signature=DA2479495909E0C52A8DFAC76D2D1CE609EADC78.F1C2F7BB105592A910234FC65CD364E625363D27", "extractor_key": "Youtube", "annotations": null, "ext": "mp4", "webpage_url": "https://www.youtube.com/watch?v=LusD_PBpq5E"}]}

From Shell Command of youtube-dl

Jay-Yuui-MacBook-Pro:youtube-dl jcyu5662$ ./youtube-dl -F http://www.youtube.com/watch?v=LusD_PBpq5E [youtube] Setting language [youtube] LusD_PBpq5E: Downloading webpage [youtube] LusD_PBpq5E: Downloading video info webpage [youtube] LusD_PBpq5E: Extracting video information Available formats: 22 : mp4 [1280x720] 18 : mp4 [640x360] 43 : webm [640x360] 5 : flv [400x240] 36 : 3gp [320x240] 17 : 3gp [176x144] 136 : mp4 [720p](DASH Video) 135 : mp4 [480p](DASH Video) 134 : mp4 [360p](DASH Video) 133 : mp4 [240p](DASH Video) 160 : mp4 [192p](DASH Video) 140 : m4a [128k](DASH Audio) 139 : m4a [48k](DASH Audio)

jaimeMF commented 10 years ago

Yes, the extraction of youtube videos use another system for the formats (old and quite ugly). Once it's changed in youtube-dl to use the new system (hopefully I'll find some time to do it), it will work as the vimeo videos and others. By the way, you won't be able to download the youtube videos unless you run the server on the same network where you download it.