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

Supplying per-site login credentials in config file #26256

Closed
csehszlovakze opened this issue Aug 6, 2020 · 4 comments
Closed

Supplying per-site login credentials in config file #26256

csehszlovakze opened this issue Aug 6, 2020 · 4 comments
Labels

Comments

@csehszlovakze
Copy link

@csehszlovakze csehszlovakze commented Aug 6, 2020

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.07.28
  • I've searched the bugtracker for similar feature requests including closed ones

Description

I'm using youtube-dl in tandem with SMPlayer to watch videos from multiple websites (YouTube, BitChute, mgtow.tv, dlive etc.) but since my login credentials aren't the same on all sites simply putting -u USERNAME -p PASSWORD in the config file will not work. SMPlayer itself lacks the feature to provide login/password to youtube-dl on its own, and just passing the password as a command line parameter is a security risk anyway cause it's visible with ps aux. Using a cookies.txt is also not an option because only YouTube has "permanent" login cookies so I'd have to re-generate it way too frequently. This feature would help with age restrictions, private videos etc.

@remitamine remitamine closed this Aug 7, 2020
@csehszlovakze
Copy link
Author

@csehszlovakze csehszlovakze commented Aug 7, 2020

I tested it with private videos of mine following what you linked but to no avail.

my .netrc file:

machine youtube login csehszlovakze@gmail.com password <REDACTED>
machine bitchute login csehszlovakze password <REDACTED>

YouTube:

$ youtube-dl --netrc -vs https://www.youtube.com/watch?v=AR3KnBGrGF0
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--netrc', u'-vs', u'https://www.youtube.com/watch?v=AR3KnBGrGF0']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.17 (CPython) - Linux-4.15.0-112-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] Downloading login page
[youtube] Looking up account info
WARNING: Unable to look up account info: HTTP Error 400: Bad Request
[youtube] AR3KnBGrGF0: Downloading webpage
ERROR: AR3KnBGrGF0: YouTube said: Unable to extract video data
Traceback (most recent call last):
  File "/home/csehszlovakze/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/home/csehszlovakze/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/home/csehszlovakze/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1893, in _real_extract
    'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
ExtractorError: AR3KnBGrGF0: YouTube said: Unable to extract video data

BitChute

$ youtube-dl --netrc -vs https://www.bitchute.com/video/UfqWXbRMjIiJ/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--netrc', u'-vs', u'https://www.bitchute.com/video/UfqWXbRMjIiJ/']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.17 (CPython) - Linux-4.15.0-112-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[BitChute] UfqWXbRMjIiJ: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); 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.
  File "/home/csehszlovakze/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/csehszlovakze/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 467, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 654, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

While BitChute throws a 404 error while not logged in, it's just a private video:

Screenshot_20200807_023714

I also tried changing the username to email but the result is the same.

@selfisekai
Copy link

@selfisekai selfisekai commented Aug 7, 2020

logging in to youtube is definetely broken currently (#26196). bitchute extractor has never supported logging in.

@csehszlovakze
Copy link
Author

@csehszlovakze csehszlovakze commented Aug 7, 2020

Thanks for the heads up.

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
3 participants
You can’t perform that action at this time.