supersaiyanmode / PyWebOSTV

Python API for controlling LG TVs (Web OS)
MIT License
261 stars 50 forks source link

YouTube launchs, but not start the video given by content_id #99

Closed Koschi2015 closed 6 months ago

Koschi2015 commented 7 months ago

Hello supersaiyanmode,

just found your lib, great work thank you for this.

I try your YouTube snipped, but it only launchs YouTube and don't start playing the video. The contend_id is a valid youTube content string (for example SNTHqiN_tXM)

Do you have any advice for me?

Trying on: Model: 55UP7009FL webOS Version: 6.3.3-439

supersaiyanmode commented 6 months ago

Hmm, this looks like Youtube might have changed its internals around how it handles these arguments. Can you maybe try the full URL?

Koschi2015 commented 6 months ago

I tried, the screen changed. instead of youTube start-screen my TV showed me big YouTube logo and a spinning circle but after 5 min the circle is still spinning.

I tried also video link for example: https://youtu.be/HwYy3xK5lvI (instead of URL:https://www.youtube.com/watch?v=HwYy3xK5lvI) Both did not work.

Why do you think they change internal handle with this argument? Did you also check it and got same result?

supersaiyanmode commented 6 months ago

Hi sorry, I am not around an LG TV. But, yes, this used to work before, and if it doesn't work now, it implies it would be broken for everyone -- Unless other similar libraries are able to do it, but not this one.

Koschi2015 commented 6 months ago

Hi,

thnx for your answer.

i found this https://community.home-assistant.io/t/play-youtube-on-smart-tv/101407 and it seems the solution is (maybe only for few TV models) is to send a delay and a button press. It looks like there is the load time from the youtube app the problem. My youtube app is loading in under one second.

Btw. Media player App also did not launch with given content_id (Video on NAS)

If i find a solution i will share it here.

Koschi2015 commented 6 months ago

YES! finally i found the solution.

The last line in this readme here https://github.com/webosbrew/youtube-webos gave me the idea for the solution. the contend_id must start with "v=" + videoID.

supersaiyanmode commented 6 months ago

Brilliant! Would you like to send a PR to update the README in this repo?

Koschi2015 commented 6 months ago

I never did one, but I will try when I am home. And I prefer something like that: videoID = „XXXXXXXXX“ contend_id = f“v={videoID}“