Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Get link option (-g) returns multiple URLs if no format is given #10707
Comments
|
This is expected behavior. |
"URL is singular.. " Enhancement? What I really want is the published date of the video; you can /sort of/ get that by continuing to follow from the provided URL [2] until you get one doesn't have a "Location:" header. The final URL has "Last-Modified:" and "Content-Length: " headers, both of which are useful. However, the "Last-Modified:" header doesn't actually give the publish date if the file has been updated for any reason. Is it possible to get the actual full timestamp (date and time) for the publish date? EPOCH seconds is fine. [2] Having multiple URLs threw off my code. |
|
|
Okay, the JSON doesn't have timestamp, it does have upload_date. And 'best' -- is that enough? It might be audio only.....? |
|
|
|
best on it's own did return a single url as expected. The code I am working on will download audio or video based on the provided ID, unless I specifically choose the format; although yt IDs are all videos, even if the image is static (I think). |
Yes that's the case. |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.09.19. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):Description of your issue, suggested solution and other information
This issue is mitigated by passing "-f best" to the command line options, then you only get one URL as expected.
So, this works:
$ youtube-dl -v -f best --proxy 127.0.0.1:8118 -g ogs_g9BlGQc
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-f', u'best', u'--proxy', u'127.0.0.1:8118', u'-g', u'ogs_g9BlGQc']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.09.19
[debug] Python version 2.7.12 - Linux-4.4.0-36-generic-x86_64-with-LinuxMint-18-sarah
[debug] exe versions: avconv 2.8.6-1ubuntu2, avprobe 2.8.6-1ubuntu2, ffmpeg 2.8.6-1ubuntu2, ffprobe 2.8.6-1ubuntu2
[debug] Proxy map: {u'http': u'127.0.0.1:8118', u'https': u'127.0.0.1:8118'}
https://r9---sn-5hnedned.googlevideo.com/videoplayback?expire=1474356685&mime=video%2Fmp4&key=yt6&ipbits=0&lmt=1474125002343928&itag=22&mt=1474334831&mv=m&ms=au&signature=C163FB6712FAFFA6115401FA8171AB3999E38400.0A917C58A8F1A07A2D2119C724FB0F7FE5715516&mm=31&mn=sn-5hnedned&upn=zNXP_mI09YE&id=a20b3f83d0651907&ip=77.247.181.165&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&ei=bZHgV5_6JsXNctn8iegD&dur=13.119&initcwndbps=4665000&pl=24&ratebypass=yes&source=youtube&requiressl=yes&nh=IgpwcjA0LmFtczE2KgkxMjcuMC4wLjE