mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 648 forks source link

user_order not working #961

Open Vrihub opened 5 years ago

Vrihub commented 5 years ago

The user_order setting doesn't seem to work anymore: maybe youtube has changed something?

Steps to reproduce:

Expected result: videos are sorted by date

Actual result: video are sorted randomly

johanbluecreek commented 5 years ago

Can verify. It stopped working out of the blue, and is the same for 'channels' searches. I have not been able to find a workaround either.

StylinGreymon commented 5 years ago

happening to me as well.

Vrihub commented 5 years ago

Uhm, besides user_order, even the order setting doesn't seem to work anymore. If I set order date and make a search, the results are not sorted by date...

Vrihub commented 5 years ago

Please note that dates displayed in the "Date" column of mpsyt are correct (they're the actual date the video was published).

Vrihub commented 5 years ago

aha, it's a youtube bug: https://support.google.com/youtube/thread/2494861?hl=en

spicysardine commented 5 years ago

Same here

cork commented 5 years ago

Any thought about adding a client site sorting?

I guess it would require fetching the entire list and do local paginating... But might be worth it as youtubes sorting has been quite bad for a long time now.

spicysardine commented 5 years ago

Any thought about adding a client site sorting?

I guess it would require fetching the entire list and do local paginating... But might be worth it as youtubes sorting has been quite bad for a long time now.

I agree with cork: Local sorting would be a convenient tool to maintain.

johanbluecreek commented 5 years ago

I have not the time to set up and look into this, but to get it rolling I will throw in my two cents...

As @cork says, first issue would be to fetch 'entire list', which I'm not sure will work (not sure about the youtube API, but API calls usually return limited entries, do they not? (maxResults is hard-coded in mps at least [0] to 50, which seems to be max [1])) Perhaps a workaround with publishedAfter and/or publishedBefore instead of order might work? [1] If those calls are not also broken?

If they are functioning, then one can fetch slices of the size of a week or a month or so, until one get a full page on mps and halt there, then continue the calls for subsequent pages.

Otherwise, fetching 50 entries at a time until they are all fetched to do a local sorting may be too many calls in a short time. Fetching slices would reduce the amount of calls (if publishedAfter and publishedBefore are functioning).

Just ideas...

[0] line 78: mps_youtube/commands/search.py

[1] https://developers.google.com/youtube/v3/docs/search/list

jiang-qian commented 5 years ago

Now it seems to be working again. This is on an older version 0.2.7.1.

johanbluecreek commented 5 years ago

Appears to be working on 0.2.8 as well.

spicysardine commented 5 years ago

Yes it does, but it doesn't mean it won't happen again! johanbluecreek's suggestion is brilliant !