JuanBindez/pytubefix

Unable to download Topic Channels

Closed this issue · 6 comments

Describe the bug
When trying to download a channel from a topic channel, I am returned no objects so am unable to download anything. I can get the Topic channel's name, but no video_urls are returned.

To Reproduce
Steps to reproduce the behavior:

I am using the following code to download videos from channels. This works correctly with normal channels:
def download_channel(url, file_type, target_extension, dir_path):
channel = Channel(url)
print(f'Downloading videos by: {channel.channel_name}')
for url in channel.video_urls:
print(url)
download_single(url, file_type, target_extension, dir_path) # working function to download a single video

in here, the channel.video_urls is simply empty same with channel.videos etc

You can try it with the following links:
I can download this channel: https://www.youtube.com/@videogamedunkey
but I cannot download this channel: https://www.youtube.com/channel/UC4CWZQtZEqHctU1RjoYjRfg

Expected behavior
A list of video urls should be returned that i can iterate through and use to download videos

Desktop (please complete the following information):

  • OS: [Windows 11]
  • Browser [Firefox]
  • Version [123]

Describe the bug When trying to download a channel from a topic channel, I am returned no objects so am unable to download anything. I can get the Topic channel's name, but no video_urls are returned.

To Reproduce Steps to reproduce the behavior:

I am using the following code to download videos from channels. This works correctly with normal channels: def download_channel(url, file_type, target_extension, dir_path): channel = Channel(url) print(f'Downloading videos by: {channel.channel_name}') for url in channel.video_urls: print(url) download_single(url, file_type, target_extension, dir_path) # working function to download a single video

in here, the channel.video_urls is simply empty same with channel.videos etc

You can try it with the following links: I can download this channel: https://www.youtube.com/@videogamedunkey but I cannot download this channel: https://www.youtube.com/channel/UC4CWZQtZEqHctU1RjoYjRfg

Expected behavior A list of video urls should be returned that i can iterate through and use to download videos

Desktop (please complete the following information):

* OS: [Windows 11]

* Browser [Firefox]

* Version [123]

try pytubefix==2.0rc2

@JuanBindez

This issue is caused because this channel only has the homepage available and pytubefix is ​​not yet able to handle the homepage's JSON.

We can create a method called .home, for example, which returns an array containing the videos, shorts, playlists and channels from the home page.

The presentation videos for subscribers and non-subscribers are volatile, so it wouldn't be worth including them.

@JuanBindez I have updated to your recommended version, but am still unable to download the second channel.

Try pytubefix==2.1rc1

@JuanBindez I have updated to your recommended version, but am still unable to download the second channel.

see if this version works and tell us if it works pytubefix==2.1rc1

Unfortunately not, sorry. It is worth noting however, that i can for example get all playlists using the channel.home functionality, and then downloading the videos from there.