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

youtube_dl & internal backends are obsolete #329

Open
elig0n opened this issue Apr 25, 2023 · 2 comments
Open

youtube_dl & internal backends are obsolete #329

elig0n opened this issue Apr 25, 2023 · 2 comments

Comments

@elig0n
Copy link

elig0n commented Apr 25, 2023

youtube_dl is obsolete. yt-dlp replaced it but its backend needs to be implemented.

>>> import pafy
>>> pafy.new("https://www.youtube.com/watch?v=bMt47wvK6u0")
ERROR: Unable to extract uploader id; please report this issue 
on https://yt-dl.org/bug . Make sure you are using the latest v
ersion; see  https://yt-dl.org/update  on how to update. Be sur
e to call youtube-dl with the --verbose flag and include its co
mplete output.
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    pafy.new("https://www.youtube.com/watch?v=bMt47wvK6u0")
  File "/home/user/.local/lib/python3.10/site-packages/pafy/pafy.py", line 124, in new
    return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 31, in __init__
    super(YtdlPafy, self).__init__(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_shared.py", line 97, in __init__
    self._fetch_basic()
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_youtube_dl.py", line 43, in _fetch_basic
    raise IOError(str(e).replace('YouTube said', 'Youtube says'
))
OSError: ERROR: Unable to extract uploader id; please report th
is issue on https://yt-dl.org/bug . Make sure you are using the
 latest version; see  https://yt-dl.org/update  on how to updat
e. Be sure to call youtube-dl with the --verbose flag and inclu
de its complete output.

Internal backend looks outdated as well:

>>> import pafy
>>> pafy.new("https://www.youtube.com/watch?v=bMt47wvK6u0")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    pafy.new("https://www.youtube.com/watch?v=bMt47wvK6u0")
  File "/home/user/.local/lib/python3.10/site-packages/pafy/pafy.py", line 124, in new
    return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_internal.py", line 42, in __init_
_
    super(InternPafy, self).__init__(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_shared.py", line 97, in __init__
    self._fetch_basic()
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_internal.py", line 50, in _fetch_
basic
    allinfo = get_video_info(self.videoid, self.callback)
  File "/home/user/.local/lib/python3.10/site-packages/pafy/backend_internal.py", line 271, in get_vi
deo_info
    sts = re.search(r'sts"\s*:\s*(\d+)', embed_webpage).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
@jjmachan
Copy link

jjmachan commented Jul 12, 2023

I'm really new to youtube-dl and pafy but wanted to use this for a project of mine. Seems like we need to change the backend to support yt-dlp also?

I'll look into this and see if this is something I can contribute

@elig0n
Copy link
Author

elig0n commented Jul 13, 2023

I'm really new to youtube-dl and pafy but wanted to use this for a project of mine. Seems like we need to change the backend to support yt-dlp also?

I'll look into this and see if this is something I can contribute

look around in the other issues you will find there are a few methods to adapt it to yt-dlp, i.e. link the youtube-dl binary to yt-dlp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants