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

"ValueError" When trying to add a channel URL that redirects to a different channel URL #276

Closed
Jerrk opened this issue Jul 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Jerrk
Copy link

Jerrk commented Jul 24, 2022

I'm running into an issue when im trying to add a list of subscriptions

it seems that when you try to add a URL that redirects to a new channel name you will get an error.

specifically this error:

[2022-07-24 11:02:36,072: WARNING/ForkPoolWorker-8] processing: https://www.youtube.com/user/DFizzy
[2022-07-24 11:02:36,072: WARNING/ForkPoolWorker-8] ParseResult(scheme='https', netloc='www.youtube.com', path='/user/DFizzy', params='', query='', fragment='')
[2022-07-24 11:02:41,260: WARNING/ForkPoolWorker-8] failed to extract channel id from https://www.youtube.com/user/DFizzy
[2022-07-24 11:02:41,264: ERROR/ForkPoolWorker-8] Task home.tasks.subscribe_to[88a4097c-4804-40c2-903e-a837592e61f3] raised unexpected: ValueError()
Traceback (most recent call last):
  File "/app/home/src/ta/helper.py", line 206, in extract_channel_name
    channel_id = url_info["channel_id"]
KeyError: 'channel_id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/.local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/root/.local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/app/home/tasks.py", line 227, in subscribe_to
    to_subscribe_list = UrlListParser(url_str).process_list()
  File "/app/home/src/ta/helper.py", line 141, in process_list
    youtube_id, id_type = self.detect_from_url(parsed)
  File "/app/home/src/ta/helper.py", line 177, in detect_from_url
    youtube_id = self.extract_channel_name(parsed.geturl())
  File "/app/home/src/ta/helper.py", line 209, in extract_channel_name
    raise ValueError from error
ValueError

in this case the url that i added "https://www.youtube.com/user/DFizzy" redirects to "https://www.youtube.com/user/DeeFizzy".

@bbilly1
Copy link
Member

bbilly1 commented Jul 24, 2022

Thanks for reaching out on Discord. Need to implement some error handling for cases like that. Or maybe there is another workaround so that still can succeed.

Thanks for reporting !

@bbilly1 bbilly1 added the bug Something isn't working label Jul 24, 2022
@Jerrk Jerrk changed the title "ValueError" Whne trying to add a channel URL that redirects to a different URL "ValueError" When trying to add a channel URL that redirects to a different channel URL Jul 25, 2022
@bbilly1
Copy link
Member

bbilly1 commented Aug 20, 2022

Thanks for reporting, channel name redirects are now handled n v0.2.1. Please update.

@bbilly1 bbilly1 closed this as completed Aug 20, 2022
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
None yet
Development

No branches or pull requests

2 participants