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

Confusing Python2/Python3 failure mode #16903

Closed
rincebrain opened this issue Jul 4, 2018 · 3 comments
Closed

Confusing Python2/Python3 failure mode #16903

rincebrain opened this issue Jul 4, 2018 · 3 comments

Comments

@rincebrain
Copy link

@rincebrain rincebrain commented Jul 4, 2018

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

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

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 the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), 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:

[debug] System config: []
[debug] User config: [u'--prefer-ffmpeg']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-u', u'PRIVATE', u'--socket-timeout', u'5', u'--retries', u'infinite', u'https://www.youtube.com/feed/history', u'-o', u'history/%(title)s.%(ext)s', u'--download-archive', u'history/dl_archive', u'-i']
Type account password and press [Return]:
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.07.04
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-6-amd64-x86_64-with-debian-9.4
[debug] exe versions: avconv 3.2.10-1, avprobe 3.2.10-1, ffmpeg 3.2.10-1, ffprobe 3.2.10-1, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[youtube:history] Downloading login page
[youtube:history] Looking up account info
[youtube:history] Logging in
WARNING: Unable to login: Invalid password
[youtube:history] Youtube History: Downloading webpage
[download] Downloading playlist: Youtube History
[youtube:history] playlist Youtube History: Downloading 0 videos
[download] Finished downloading playlist: Youtube History

python3 ./youtube-dl:

[debug] System config: []
[debug] User config: ['--prefer-ffmpeg']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-u', 'PRIVATE', '--socket-timeout', '5', '--retries', 'infinite', 'https://www.youtube.com/feed/history', '-o', 'history/%(title)s.%(ext)s', '--download-archive', 'history/dl_archive', '-i']
Type account password and press [Return]:
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.07.04
[debug] Python version 3.5.3 (CPython) - Linux-4.9.0-6-amd64-x86_64-with-debian-9.4
[debug] exe versions: avconv 3.2.10-1, avprobe 3.2.10-1, ffmpeg 3.2.10-1, ffprobe 3.2.10-1, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[youtube:history] Downloading login page
[youtube:history] Looking up account info
[youtube:history] Logging in
[youtube:history] Checking cookie
[youtube:history] Youtube History: Downloading webpage
[download] Downloading playlist: Youtube History
[youtube:history] Youtube History: Downloading page #1
^C
ERROR: Interrupted by user

Description of your issue, suggested solution and other information

I have a script which I periodically use to fetch the history playlist of an account for watching later - you can see the arguments it's invoked with in the logs above.

Today, I tried running said script, and it informed me the password was incorrect. I tried again, and again it informed me I was wrong. At that point, I copied-and-pasted the password from a text editor to be sure I had typed it correctly, and still.

I pulled up a new browser session, confirmed pasting said password worked for signing into Youtube, and tried again, to no avail.

For no good reason, I tried invoking youtube-dl with python3 ./youtube-dl instead of just ./youtube-dl, and lo, with python3, it works fine, every time. If I revert to using ./youtube-dl, it fails, every time. (In the interest of being complete, I tried python2 ./youtube-dl, and it also fails every time.)

(I also tried hardcoding the password using -p in the script, to be sure I wasn't somehow paste-mangling it, and the above behavior remains.)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 4, 2018

Most likely your script improperly handles/passes strings.

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'BaW_jenozKc', u'-v', u'-u', u'PRIVATE', u'-p', u'PRIVATE']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2018.06.25
[debug] Python version 2.7.12 (CPython) - Windows-10-10.0.10240
[debug] exe versions: ffmpeg N-85653-gb4330a0, ffprobe N-85653-gb4330a0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
Type 2-step verification code and press [Return]:
[youtube] Submitting TFA code
[youtube] Checking cookie
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
...
@dstftw dstftw closed this Jul 4, 2018
@rincebrain
Copy link
Author

@rincebrain rincebrain commented Jul 4, 2018

I tried invoking it on the command-line, and whether interactively or passing the password single-quoted, it still fails.

Also, the password hasn't changed, nor has the script, and it just started failing.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 4, 2018

See --print-traffic for what's actually being sent.
For any further investigations you must provide reproducible account 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.