regseb / castkodi

WebExtension to cast videos and music to Kodi.
MIT License
104 stars 24 forks source link

Titles not being show until after a video has played? #146

Closed develroo closed 1 week ago

develroo commented 1 week ago

When the addon is queuing items, it used to show the titles of all the items in the list. For about a week now, it now only shows the title after the item has played, and the remaining items are listed as video unavailable see below.

Screenshot from 2024-10-26 17-01-26

The bizarre thing though is, in another Firefox profile which is set up and connected to the same Kodi instance with exactly the same permissions and settings, I don't get that issue.

Screenshot from 2024-10-26 17-08-03

I honestly cannot explain it, as the profile that has the problem is a profile I just use for YouTube and so has very few add-ons that could interfere, and I have disabled them all one by one anyway. I even removed and re added it. Having to set it up again.

In the Kodi logs the connections from both profiles looks the same. So no errors.

2024-10-26 17:35:08.107 T:10582    info <general>: JSONRPC Server: New connection added
2024-10-26 17:35:09.345 T:10582    info <general>: WebSocket: connection closed by client
2024-10-26 17:35:09.345 T:10582    info <general>: JSONRPC Server: Disconnection detected
2024-10-26 17:35:32.724 T:10582    info <general>: JSONRPC Server: New connection added
2024-10-26 17:35:34.192 T:10582    info <general>: WebSocket: connection closed by client
2024-10-26 17:35:34.192 T:10582    info <general>: JSONRPC Server: Disconnection detected

Any idea how to debug this issue and why it is only a problem in one browser profile?

FWIW:

Firefox 131.0.3 (64-bit) (both profiles) Addon verision 7.12.0 (both profiles)

Thanks.

regseb commented 1 week ago

Here's the sequence for showing titles.


For a few weeks now, I've been having the same problem with unit tests run in Node.js: the title is no longer retrieved. I think YouTube has added an anti-bot filter (to block scraping). In the unit tests, YouTube's anti-bot should give a bad score because the request comes from Node.js (perhaps with the TLS fingerprint). And in your case, your score must reach a threshold because of the fetch() and other criteria.

I don't have the problem with Firefox 131.0.3 and Chromium 130.0.6723.58 on Ubuntu 24.04.1 LTS. Either YouTube is doing A/B testing and the new anti-bot only applies to one of your profiles. Or the anti-bot gives two different scores, because the criteria are different between your two profiles.


Kodi and plugin.video.youtube are not related to this issue. The problem is from the method in Cast Kodi that extracts the title from the YouTube page. And perhaps the browser also has an effect.

develroo commented 1 week ago

Either YouTube is doing A/B testing and the new anti-bot only applies to one of your profiles. Or the anti-bot gives two different scores, because the criteria are different between your two profiles.

I feel you could be right, as I cannot see any other differenced in the settings.

Ok I just tested a theory. I logged out of YT, cleared all cookies and site data and logged in in again and now the titles appear as normal.

Something in my YT profile was stopping it. I'd be curious what that was, but sadly not, I have deleted everything I can't investigate. Oh, well.

Put it down to some random edge case which only I, Beta boy, would have found.

Thanks for a great addon btw. I use it every day without fail.