8000 My working version of pytube as of October 2024 by WildDIC · Pull Request #2055 · pytube/pytube · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

My working version of pytube as of October 2024 #2055

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

WildDIC
Copy link
@WildDIC WildDIC commented Oct 23, 2024

Collected all the fixes for the last two years and posted them on GitHub.

@chriscow
Copy link
chriscow commented Nov 1, 2024

Works for me - @WildDIC you are awesome!

@chriscow
Copy link
chriscow commented Nov 1, 2024

@WildDIC - I usually download audio-only. I did notice with this branch that, although the audio downloads, there is a lot of dead silence at the end of the audio. It seems to be exactly double in length.

@WildDIC
Copy link
Author
WildDIC commented Nov 1, 2024

Today I found new bug. Every video download only 315 MB.
Switched to pytubefix. :)

@SketchyUnicorns
Copy link

By any chance are you able to get the titles to work properly.
I get "None" when trying to download or view a playlist using both master and your versions.

@flyinggoatman
Copy link

Does this also include the patch for urls that look like www.youtube.com/@channelname?

found here?
#1422

Also are the youtube video links fixed like in

https://youtu.be/randomid

I've been getting errors whenever I try to pull the channel from any video.

Traceback (most recent call last):
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\fly\SERVERS\BOTS\DISCORD\QualityYouTube\QualityYouTubeBot\QualityYouTubeBot.py", line 225, in on_message
    else video_pull(channel_url, DEBUG_MODE)
  File "C:\Users\fly\SERVERS\BOTS\DISCORD\QualityYouTube\QualityYouTubeBot\functions.py", line 86, in video_pull
    channel_id = YTV.channel_id
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\__main__.py", line 424, in channel_id
    return self.vid_info.get('videoDetails', {}).get('channelId', None)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\__main__.py", line 246, in vid_info
    innertube_response = innertube.player(self.video_id)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\innertube.py", line 300, in player
    return self._call_api(endpoint, query, self.base_data)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\innertube.py", line 242, in _call_api
    response = request._execute_request(
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\request.py", line 37, in _execute_request
    return urlopen(request, timeout=timeout)  # nosec
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
2025-04-23 18:04:23 ERROR    discord.client Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\fly\SERVERS\BOTS\DISCORD\QualityYouTube\QualityYouTubeBot\QualityYouTubeBot.py", line 223, in on_message
    channel_pull(channel_url, DEBUG_MODE)
  File "C:\Users\fly\SERVERS\BOTS\DISCORD\QualityYouTube\QualityYouTubeBot\functions.py", line 67, in channel_pull
    c = Channel(channel_url)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\contrib\channel.py", line 24, in __init__
    self.channel_uri = extract.channel_name(url)
  File "C:\Users\fly\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\extract.py", line 195, in channel_name
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: channel_name: could not find match for patterns

The code used to work.

Copy link
@flyinggoatman flyinggoatman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love these changes, can we have them updated?

flyinggoatman added a commit to flyinggoatman/pytube that referenced this pull request Apr 23, 2025
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

Successfully merging this pull request may close these issues.

4 participants
0