I’ve decided to make a post because I’ve run out of ideas on a problem.
I am developing a chrome extension to remove shorts from youtube. This includes shorts sections, shorts recommender, etc.
The way the extension works is by injecting javascript code into the page like a classic extension.
I’ve made good progress in removing most of the parts with shorts, however, when I tried to remove the shorts tab in the youtube channels, I encountered a lot of problems.
1 – I first tried to take the position of the shorts button to remove it (3rd position in most cases).
- however, a youtube channel may or may not have the shorts tab, depending on whether it has shorts or not, and may also have no videos, which removes the tab for videos and advances the shorts tab.
2 – I tried to use the section name (Shorts)
- Except that this is impossible because youtube is available in many languages, and the name changes completely depending on the language. This would mean translating the text, which would be too slow.
3 – I’ve tried using YouTube’s api to find out whether the channel has shorts or not and use the position accordingly.
- The problem is that there’s no difference between short videos and normal videos in the YouTube api.
"statistics": {
"viewCount": ,
"subscriberCount": ,
"hiddenSubscriberCount": ,
"videoCount":
},
4 – I then tried to use the url to which the buttons pointed, but it’s not easy because it’s not a simple href but a redirection by the server. I didn’t succeed and it seems too slow and to heavyy.
Basically, I’d like to remove the shorts tab from youtube channels quickly and cleanly.
Thank you in advance
WIZI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.