Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Get youtube-dl compatible URLs from playlists #12485

Closed
Babbie opened this issue Mar 18, 2017 · 4 comments
Closed

[Question] Get youtube-dl compatible URLs from playlists #12485

Babbie opened this issue Mar 18, 2017 · 4 comments

Comments

@Babbie
Copy link

@Babbie Babbie commented Mar 18, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.03.16. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.03.16

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

I am currently making a Discord bot that will use youtube-dl to obtain music files and play them from URLs (so the usual). To make this a little easier, I wanted to run a command with youtube-dl to obtain URLs from a playlist, so I could perform individual handling on each entry in such a playlist. The problem is that, at least with YouTube playlists, the (two) URLs that are returned per video will not work if they are then supplied to youtube-dl again, presumably due to some security handling. My question is: How do I get youtube-dl compatible URLs out of a playlist using youtube-dl? Of course, I want to avoid having to manually insert the correct URL before the video ID (eg. prepending http://youtube.com/v/ to the ID) as this would bloat my code significantly and make it much more difficult to keep it up to date with new services added to youtube-dl.

For a concrete example:
I want to run something like

youtube-dl --get-url https://www.youtube.com/playlist?list=PLWAMgeSbi1zHcUg7V8g9gCaGzIR0APqG7

and then run

youtube-dl <url>

on the individual URLs that are returned, separately, but the URLs that are returned cannot do this (they always return errors)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 18, 2017

Provide concrete example with concrete URLs of what are you trying to do.

@Babbie
Copy link
Author

@Babbie Babbie commented Mar 18, 2017

Updated.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 18, 2017

--flat-playlist --dump-json and parse from JSON.

@dstftw dstftw closed this Mar 18, 2017
@Babbie
Copy link
Author

@Babbie Babbie commented Mar 18, 2017

I did not realise that only an ID is sufficient for YouTube specifically. Thanks for the heads-up and sorry for the superfluous issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.