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 Dailymotion authentication #11491

Closed
4 of 8 tasks
RomainBoulay opened this issue Dec 19, 2016 · 6 comments
Closed
4 of 8 tasks

Support Dailymotion authentication #11491

RomainBoulay opened this issue Dec 19, 2016 · 6 comments

Comments

@RomainBoulay
Copy link

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 that [x])
  • Use Preview tab to see how your issue will actually look like

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

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

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 -v flag 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

$ youtube-dl -v http://www.dailymotion.com/video/x55kf8p_miss-france-miss-mayotte-elue-mis-gamelle-avec-une-chute-spectaculaire-en-gros-plan_tv
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.dailymotion.com/video/x55kf8p_miss-france-miss-mayotte-elue-mis-gamelle-avec-une-chute-spectaculaire-en-gros-plan_tv']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.18
[debug] Python version 2.7.10 - Darwin-16.1.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[dailymotion] x55kf8p: Downloading webpage
WARNING: unable to extract comment count; 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.
[dailymotion] x55kf8p: Downloading m3u8 information
[dailymotion] x55kf8p: Downloading m3u8 information
[dailymotion] x55kf8p: Downloading m3u8 information
[dailymotion] x55kf8p: Downloading m3u8 information
[debug] Invoking downloader on u'https://www.dailymotion.com/cdn/H264-512x384/video/x55kf8p.mp4?auth=1482266618-2562-bkpla9gw-00148b4de354a1ba8484c11a9094a281'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1699, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1641, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 353, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 61, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 656, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
...
<end of log>

Description of your issue, suggested solution and other information

This issue is a follow-up of this one: #11438 (comment)

When a client is downloading several dailymotion videos, the website presents a login page that prevents youtube-dl to work normally.

I tried to workaround the issue using --username ... --password ... but the authentication is not yet supported for this website.

@jellyfishcoder
Copy link

I am looking into this, but it seems that the official dailymotion API, which even has a python implementation, will not work in this case. The official API requires an api_secret key for every application that uses its api to perform requests as a user (such as accessing private videos). On the website it specifically says that "Make sure your API secret remains secret though, do not use this kind of authentication for any service that is running on the client if you do not want your API secret to be publicly exposed." This means that it seems the best option would be to somehow simulate logging in by filling the fields, then downloading the video, then destroying the login cookie.

@yan12125
Copy link
Collaborator

it seems the best option would be to somehow simulate logging in by filling the fields

Yes, and that's usually the only acceptable approach in youtube-dl

@RomainBoulay
Copy link
Author

Thanks for your comments!

Just to clarify: is this log-in simulation something you plan to implement? Or is it what I should be doing?

Side question: wouldn't it be easier to ask the youtube-dl user for an API token? (as it's free and quite easy to generate)

Cheers.

@yan12125
Copy link
Collaborator

it's free and quite easy to generate

As a programmar, I don't think generating an API token is easy :)

is this log-in simulation something you plan to implement? Or is it what I should be doing?

I haven't started the implementation and might not be in the near future. You can go ahead.

@RomainBoulay
Copy link
Author

As a programmar, I don't think generating an API token is easy :)

I meant quite easy to generate manually :)

I haven't started the implementation and might not be in the near future. You can go ahead.

I'm not sure either I can do it in a short term, unfortunately. Where would one add the login code in your project? Is there another clean example one could copy?

@yan12125
Copy link
Collaborator

(My personal feeling is that most websites' UI is too awful for users/developers to generate an API token.)

Actually the reason not using API tokens is that they're usually limited. For example on Github you can't issue too many API requests a day, but you can refresh webpages as much as you want.

Is there another clean example one could copy?

Search "def _login" in youtube-dl

meunierd referenced this issue in meunierd/youtube-dl Feb 13, 2020
- extract http formats included in m3u8 manifest
- fix user extraction(closes #3553)(closes #21415)
- add suport for User Authentication(closes #11491)
- fix password protected videos extraction(closes #23176)
- respect age limit option and family filter cookie value(closes #18437)
- handle video url playlist query param
- report alowed countries for geo-restricted videos
pareronia referenced this issue in pareronia/youtube-dl Jun 22, 2020
- extract http formats included in m3u8 manifest
- fix user extraction(closes #3553)(closes #21415)
- add suport for User Authentication(closes #11491)
- fix password protected videos extraction(closes #23176)
- respect age limit option and family filter cookie value(closes #18437)
- handle video url playlist query param
- report alowed countries for geo-restricted videos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants