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

Wrong channel downloaded #46

Closed
lightonflux opened this issue Jun 2, 2023 · 4 comments
Closed

Wrong channel downloaded #46

lightonflux opened this issue Jun 2, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@lightonflux
Copy link

Used link: https://youtube.com/@TomScottGo
yt_fts version: 0.1.15

Downloaded subs where from all from @tomscottplus. This is not what i expected.

@TeddyBear06
Copy link
Contributor

Hi,

Do you mean you used this link https://www.youtube.com/@TomScottGo/videos like the command below?

yt-fts download "https://www.youtube.com/@TomScottGo/videos"

If I'm not mistaken, the channel ID is extracted from this specific URL (the /videos at the end of the URL is required).

@NotJoeMartinez NotJoeMartinez added the bug Something isn't working label Jun 2, 2023
@NotJoeMartinez
Copy link
Owner

Seems like this happens on channels where they have extra channels listed on their home page.

problem might be from line 38 in this function because it gets the first channel id it finds:

def get_channel_id(url, s):
    """
    Scrapes channel id from the channel page
    """
    res = s.get(url)
    if res.status_code == 200:
        html = res.text
        channel_id = re.search('channelId":"(.{24})"', html).group(1)
        return channel_id
    else:
        return None

@TeddyBear06
Copy link
Contributor

You're right.

There are multiple channelId matches (exactly 4) on the homepage (but only one the channel's videos page, as expected).

We need to check the given channel URL against the expected pattern.

@lightonflux
Copy link
Author

lightonflux commented Jun 5, 2023

Thanks for adding the code in #52. That would have been good enough. Because i aborted a task, as i "couldn't" download scotts subtitles before, when using the link without /videos.. 👍

The current state is good enough for me. Feel free to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants