-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
[twitter] Broken Python 2 support #20673
Comments
Of course I omitted the crucial fact that this only breaks when using a cookie file. |
|
Updated. Sorry, should have just followed the instructions carefully. Not that it adds anything that wouldn’t have been obvious from the traceback :P |
this patch fixes the problem, but not sure if it's the right way( diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 0889288f0..efe0006f6 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -2813,7 +2813,7 @@ class InfoExtractor(object):
""" Return a compat_cookies.SimpleCookie with the cookies for the url """
req = sanitized_Request(url)
self._downloader.cookiejar.add_cookie_header(req)
- return compat_cookies.SimpleCookie(req.get_header('Cookie'))
+ return compat_cookies.SimpleCookie(str(req.get_header('Cookie')))
def get_testcases(self, include_onlymatching=False):
t = getattr(self, '_TEST', None) |
I can confirm that I was seeing this same problem, and switching my shell to my python3 install does fix the problem. (Using the same cookies file.) |
|
I am seeing this same error output after an unattended-upgrade this morning. It was working earlier this week. My os is debian. The site is not twitter however, it is dailymotion.com kpmiller mentioned python3. I don't understand the details of that fix, if it applies for dailymotion. |
Any news for Dailymotion.com? we really need a fix for this site. Thank you |
why is it closed as it doesn't work with dailymotion? |
Same thing for me, I'll like to have a simpler solution ❤️ |
Easy solution is to define an alias, and add it to the home .bash_aliases file |
I fixed this by upgrading from python 2 to 3.8.2 (macos, brew and pyenv) Hope this helps Regards |
* https://github.com/ytdl-org/youtube-dl: [youtube] prioritize information from YoutubeIE for playlist entries(closes ytdl-org#28619, closes ytdl-org#28636) [extractor/common] fix _get_cookies method for python 2(ytdl-org#20673, ytdl-org#23256, ytdl-org#20326, closes ytdl-org#28640)
Excellent! The latest commit above has fixed the issue. No need for prepending |
Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2019.04.07. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
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 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 ```):Description of your issue, suggested solution and other information
Encountered this issue on openSUSE Tumbleweed.
It seems at least the Twitter extractor no longer works with Python 2, which is unfortunate because the youtube-dl executable uses a shebang that will invoke the Python 2 interpreter on most distributions. I suggest changing the shebang so it uses Python 3 in addition to fixing this issue.
The text was updated successfully, but these errors were encountered: