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

Support for Downloading HTTP Authentication Protected Podcast Feeds #20258

Closed
jessebodin opened this issue Mar 5, 2019 · 2 comments
Closed

Support for Downloading HTTP Authentication Protected Podcast Feeds #20258

jessebodin opened this issue Mar 5, 2019 · 2 comments
Labels

Comments

@jessebodin
Copy link

@jessebodin jessebodin commented Mar 5, 2019

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.03.01. 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 2019.03.01

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


Description of your issue, suggested solution and other information

One of my favorite uses of youtube-dl is as an archiving solution. Recently I was attempting to archive some podcasts that were protected by HTTP Authentication (https://username:password@example.com/podcast/feed). I know that premium podcasts distribute their URLs in this format for supporters. Most podcast clients can parse this type of url.

PS C:\Archive\Podcasts> .\youtube-dl.exe https://username:password@example.com/podcast/feed
[generic] feed: Requesting header
WARNING: Could not send HEAD request to https://username:password@example.com/podcast/feed: nonnumeric port: 'password@example.com'
[generic] feed: Downloading webpage
ERROR: Unable to download webpage: nonnumeric port: 'password@example.com' (caused by InvalidURL("nonnumeric port: 'password@example.com'",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

I tried every combination of the -u username -p password I could.

Solution

You can get around this by inserting the Authorization header into youtube-dl's request.

The authorization header is formatted as "Authorization: Basic [username:password encoded with base64]"

Note that you have to encode your username:password beforehand.

username:password encoded with Base64 is dXNlcm5hbWU6cGFzc3dvcmQ=

So your authorization header will look like this Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

You can insert this header with the --add-header command

Your new youtube-dl command will look like this:

PS C:\Archive\Podcasts> .\youtube-dl.exe https://example.com/podcast/feed --add-header "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="

I was able to confirm that this works for me. Could this process be automated when "username:password@example.com" is detected in the URL?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 5, 2019

You must provide concrete examples with concrete reproducible credentials.

@dstftw dstftw closed this Mar 5, 2019
@dstftw dstftw added the incomplete label Mar 5, 2019
@jessebodin
Copy link
Author

@jessebodin jessebodin commented Mar 5, 2019

Any way I could privately relay an example with credentials?

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.