ThioJoe / YT-Spammer-Purge

Allows you easily scan for and delete scam comments using several methods.
GNU General Public License v3.0
4.52k stars 391 forks source link

[Bug]: Channels with Handle URLs Cause Error #974

Closed Lightning11wins closed 1 year ago

Lightning11wins commented 1 year ago

Duplicate Issues

What happened?

You cannot enter a channel URL that uses one of the new YouTube handles for scanning. The channel in question is GTWScar Edits.

Release version

2.17.0-Beta4

Steps to reproduce

  1. Open program.
  2. Select option 2.
  3. Enter "https://www.youtube.com/@GTWScar_Edits" as the channel URL.
  4. See error message.

What platform are you seeing this problem on?

Windows (.exe file)

Relevant log output

> At any prompt, enter 'X' to return here
> Enter 'Q' now to quit
NOTE: This beta version uses a new method for checking updates. It is possible it will not work properly, so you should periodically check for new versions on the GitHub page yourself until the stable release.

-------------------------------- Scanning Options --------------------------------
      1. Scan specific videos
      2. Scan recent videos for a channel
      3. Scan recent comments across your Entire Channel
      4. Scan a specific community post (Experimental)
      5. Scan recent community posts for a channel (Experimental)

--------------------------------- Other Options ----------------------------------
      6. Create your own config file(s) to run the program with pre-set settings
      7. Remove comments using a pre-existing list or log file
      8. Recover deleted comments using log file
      9. Check & Download Updates

Choice (1-9): 2

Enter a channel ID or Link to scan recent videos from
   > If scanning your own channel, just hit Enter

Enter Here: https://www.youtube.com/@GTWScar_Edits

Error: Invalid Channel link or ID!

Enter a channel ID or Link to scan recent videos from
   > If scanning your own channel, just hit Enter

Enter Here:

Screenshots

Broken

FlameSoulis commented 1 year ago

Can vouch that this is an issue.

Lightning11wins commented 1 year ago

Mattsblack pointed out in a duplicate issue that this also affects @TheoJoe's channel

Firecul commented 1 year ago

Mattsblack pointed out in a duplicate issue that this also affects @theojoe's channel

It will affect them all, support has not been added yet for that format. ThioJoe will have to check the API can handle it then add in that contingency.

Lightning11wins commented 1 year ago

Oops, sorry. I didn't mean to close that!

Practicalbutterfly5 commented 1 year ago

Videos are at $channel_url/videos Shorts at $channel_url/shorts Livestreams at $channel_url/streams Where $channel_url is the new @ format.

Another option which might work is to get the channel id like UC-Te-TvBZys***sQVtH2kcA and then use old channel url format, so all previous code will still work.

TechStudent10 commented 1 year ago

Videos are at $channel_url/videos Shorts at $channel_url/shorts Livestreams at $channel_url/streams Where $channel_url is the new @ format.

Another option which might work is to get the channel id like UC-Te-TvBZys***sQVtH2kcA and then use old channel url format, so all previous code will still work.

This is a potential workaround for now, until a fix can be applied.

Sarah1390 commented 1 year ago

Good thing I have the Channel ID's saved from other issues I have encountered for the channels I commonly scan. The only way that I can predictably get the channel ID is clicking on the channel while you are in the comments section meaning you would have to find a comment that the owner of the channel posted, click on their name and it brings me to the channel displaying the specific YouTube ID.

Lightning11wins commented 1 year ago

Good thing I have the Channel ID's saved from other issues I have encountered for the channels I commonly scan. The only way that I can predictably get the channel ID is clicking on the channel while you are in the comments section meaning you would have to find a comment that the owner of the channel posted, click on their name and it brings me to the channel displaying the specific YouTube ID.

I use Chrome, so I can just right-click, then click "View Page Source" and search for channel_id= in the file and copy whatever comes after that until the quote ("). That has worked so far, but it's a bit annoying and I'd prefer that the channel URL worked, especially since the program (incorrectly) says that it does.

ThioJoe commented 1 year ago

I'll fix this relatively soon. I've been waiting till YouTube basically fully rolled out Handles but it seems to be taking longer than I expected. On my account it still shows usernames like before, but when logged out it shows handles.

Lightning11wins commented 1 year ago

Great, thank you! I mostly scan other people's channels, and the majority of channels use handle URLs now, so this upgrade will be very helpful.

ThioJoe commented 1 year ago

It actually seems that YouTube hasn't even added support for handles to the API yet.

Though someone has apparently figured out how to fetch channel IDs with handles using HTTP it seems. For example: https://yt.lemnoslife.com/channels?handle=thiojoe

The related repo: https://github.com/Benjamin-Loison/YouTube-operational-API

Lightning11wins commented 1 year ago

That's very strange, especially since most/all of the URLs are handle-based (eg. "https://www.youtube.com/@Technoblade")...

TechStudent10 commented 1 year ago

That's very strange, especially since most/all of the URLs are handle-based (eg. "https://www.youtube.com/@Technoblade")...

Yep. All channels have a handle now, even if they are unpleasant (some people have user-xxxxx as theirs). Strange how YouTube just isn't adding support for handles in their API.

Lightning11wins commented 1 year ago

I'm new to the whole software development field. Is it normal for an API to take a few weeks to be updated when a new, major feature comes out?

TechStudent10 commented 1 year ago

I'm new to the whole software development field. Is it normal for an API to take a few weeks to be updated when a new, major feature comes out?

It honestly shouldn't. When you think about it, YouTube needs to code the backend so that it handles the new Handles (I know not funny). So they should've programmed it if it is already so widespread. Unless they have an internal API and public API, Handles should've been in the API by now.

ThioJoe commented 1 year ago

They literally never added API support for community posts after all these years, so who knows when they'll add support for handles.

TechStudent10 commented 1 year ago

They literally never added API support for community posts after all these years, so who knows when they'll add support for handles.

Then maybe it's time to switch to a community made API? I don't know if they exist, but if they provide more features than the standard YouTube API, then maybe it's the best option.

ChristopherW commented 1 year ago

How do third party sites like https://commentpicker.com/youtube-channel-id.php obtain the Channel ID? I just tested that with https://www.youtube.com/@GamersNexus and it correctly returned its Channel ID (UChIs72whgZI9w6d6FhwGGHA).

I note the Channel ID is still currently included in the page source for various profile pages, so perhaps that could be used as a fallback if the YTSP was able to parse channel page HTML? Not ideal I understand given that it should be surfaced through the API, but as YT is pushing hard to migrate from IDs to usernames it might be handy to have an interim solution.

TechStudent10 commented 1 year ago

How do third party sites like https://commentpicker.com/youtube-channel-id.php obtain the Channel ID? I just tested that with https://www.youtube.com/@GamersNexus and it correctly returned its Channel ID (UChIs72whgZI9w6d6FhwGGHA).

I note the Channel ID is still currently included in the page source for various profile pages, so perhaps that could be used as a fallback if the YTSP was able to parse channel page HTML? Not ideal I understand given that it should be surfaced through the API, but as YT is pushing hard to migrate from IDs to usernames it might be handy to have an interim solution.

This is a bit of an ugly approach. Maybe we should investigate a more elegant solution (why do I sound like a fancy person?)

ThioJoe commented 1 year ago

I was actually able to add a workaround easier than expected, so handles should work now in the latest beta6.

Basically it does the same type of search request to the API that I was doing for old custom URLs. It just does an API search for the name and hopefully with handles that should always return the correct channel.

Lightning11wins commented 1 year ago

Great! Thank you! This tool is so helpful.