user234683 / youtube-local

browser-based client for watching Youtube anonymously and with greater page performance
GNU Affero General Public License v3.0
544 stars 66 forks source link

Sort subscriptions by published date #91

Open Sogolumbo opened 3 years ago

Sogolumbo commented 3 years ago

I think the subscriptions should be sorted by the published date. Not everyone has the server running every day.

Especially for people who also use Newpipe this is a very unexpected behaviour.

The subscriptions list is not actually sorted by the date the video is published; it's sorted by the date that the program became aware that the video existed.

This is because channels are checked at 10x the rate that the channel posts videos. Channels that post more often are checked more frequently. This is to cut down on the number of requests, since users might have hundreds, even over a thousand subscriptions, and the vast majority of those will be channels that don't post very often.

So if a channel posts one video every 10 months on average, then on average it's checked every month. Once that channel posts a video, it could take up to a month for the program to see it. If we were sorting by the date the video was published, then that video would be buried under videos from channels that post more often, so the user would never see it.

There's some exceptions to these rules (for instance, the first time a channel is checked, the videos are put into the subscriptions based on upload date). It's also sorted by upload date if over 6 new videos are seen, so that if a channel is muted or the autochecker is off for awhile, we don't have a similar problem once it is checked after having posted say 25 videos. This rule might need some more thought though. The rules in general might need some tweaks here and there to get the optimum balance of network efficiency vs smoothness.

Source: #49

This does not seem to work as expected (in 2.7.0): I have a random order of videos from the dates of a five day span after not running youtube-local for some days.

One option to handle this is to add different sorting options. Also it might make sense to somehow highlight low frequency channels (<1 Video per day/week/?) and their videos.

Or maybe it is possible to find out when either sorting makes more sense.
E.g. when I check all channels I want all new videos to be added in the order of their published date. So we could first collect all new videos, then sort them by their published date and finally add all of them to the top of the list. To me this seems to be a solid middle ground between publication and notification sorting.
Another idea is to look at how long it's been since the last check of that channel was made. If that time is bigger than (some factor times) the average time between two videos from that channel we will collect those videos in a temporary list and sort it by publication date. In all other cases we will put those videos in a second temporary list which won't be sorted. Then the sorted list is added first and the unsorted list is added secondly to the subscription video list. This will put less frequent channels further to the top and will make sure that the videos are sorted

user234683 commented 3 years ago

Noted. I'll be thinking about the best way to solve this taking into account your suggestions. Before I delve into the NewPipe code, do you happen to know what strategy NewPipe uses for this problem? Do they also vary checking frequency based on posting rate? And do they do anything special once an old video from an infrequent channel is discovered?

Sogolumbo commented 3 years ago

I think they just check all subsriptions and put them in the order of their publication. The check is triggered manually

solnyshok commented 4 days ago

Hi! autochecking feed might lead to your IP being blacklisted for some period of time (infamous youtube sign in request). Now, that my IP changed after several days, I was able to check feeds and also noticed the problem with sorting. I would prefer manual checking and feed sorted by date/time