MShawon / YouTube-Viewer

A multithreaded view bot for YouTube
MIT License
1.49k stars 760 forks source link

Adding option to skip ad or not #255

Closed josips1999 closed 3 years ago

josips1999 commented 3 years ago

The program usually doesn't skip ads which is something important from the youtube end. Please add that feature to skip or not skip commercials

MShawon commented 3 years ago

how long did you run the bot and observed that it doesn't skip ads?

josips1999 commented 3 years ago

whenever i start it sometimes it skips and sometimes it doesnt

MShawon commented 3 years ago

the script finds the duration of a video from the browser only once then it stores that duration in a python dictionary. so later it can use that duration without executing javascript every time to find the duration. so if video duration is not found in a python dictionary it will not skip the ads. Meaning when a video is playing for the very first time it will not skip the ads. And if video duration is less than 30 seconds it won't skip ads. Other than that it skips ad most of the time and only skips the first ad that appears.

josips1999 commented 3 years ago

Got it