Leanback YouTube on TV for PC on Chrome
#1
Hello, I am not sure if this is where I should post this, if not, can the MOD please move this and I apologize in advance.

Anyhow, after a little trial and error, I have figured out how to launch leanback youtube on tv for Windows in Chrome using a Smart TV user agent switch and launching it through a batch file. Using a portable installation of chrome allows everything to "just work"
Instructions:
  • Install portable chrome to the directory of your choosing and make note of its location. 
  • Open chrome portable and sign in, go to the web store and install User-agent-swticher. (this is used for signing into youtube for tv before anything else)
  • Once installed, right click on the extension and go to 'Options"
  • Where it says "new user agent string" paste this line
Code:
Mozilla/5.0(SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15
  • give it any name and indicator flag you like, click add
  • click on the user agent extension>safari>(useragent name you chose)
  • go to youtube.com/tv
  • click sign in, follow instructions for activating.
  • Once signed in on YouTube on TV, you can right-click the useragent extension and remove it.
  • Open notepad or Notepad++ and paste all of the following as one line of code:
Code:
"root\path\to\chrome\portable\App\Chrome-bin\chrome_proxy.exe" --user-data-dir="root\path\to\chrome\portable\Data\profile" --profile-directory=Default --user-agent="Mozilla/5.0(SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15" --kiosk https://www.youtube.com/tv#/surface?c=FEtopics&resume
  • You will replace "root\path\to\chrome\portable\" with the root of the portable chrome install folder. So if you installed it to C:\GoogleChromePortable64", you would replace the path to chrome at beginning and the "--user-data-dir=" it would look like this:

Code:
"C:\GoogleChromePortable64\App\Chrome-bin\chrome_proxy.exe" --user-data-dir="C:\GoogleChromePortable64\Data\profile" --profile-directory=Default --user-agent="Mozilla/5.0(SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15" --kiosk https://www.youtube.com/tv#/surface?c=FEtopics&resume
  • Save as .bat file ext to an easy to remember location and exit.

Next you need to convert that .bat to an exe. When the program opens (launch Bat_To_Exe_Converter_(x64) for 64-bit systems).
  • select your .bat then select invisible for visibility.
  • Under architecture, select whether your system is 32 or 64 bit.
  • (optional) on the version tab, you can include an icon if you want.
  • click the "Compile" button (this is where you may get the AV false positive, its fine, I have been using this program for years and have never had issues)
Note: The .exe will be saved in the same location as your .bat file for easily locating after you're through


Bonus: 
  • If you have autohotkey installed and have AdvancedMCERemoteMapper, you can create a script and add these lines for launching and exiting with ease.
  • replace "path\to\bat-exe\you\created\YouTube on TV.exe" with the location of the .exe you created earlier. 
Code:

#SingleInstance, Force
HideShowTaskbar(hide := hide)
   
HideShowTaskbar(action) {
   static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
   VarSetCapacity(APPBARDATA, size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
   NumPut(size, APPBARDATA), NumPut(WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
   NumPut(action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
   DllCall("Shell32\SHAppBarMessage", UInt, ABM_SETSTATE, Ptr, &APPBARDATA)
}    

^!V::
          ;this launches youtube on tv using Ctrl+Alt+V
if WinExist("YouTube on TV - Google Chrome ahk_class Chrome_WidgetWin_1")
   {
      WinActivate
      return
   }
Run "path\to\bat-exe\you\created\YouTube on TV.exe"
return
+Escape::
          ;shift+escape will close the tab and close portable chrome as well. Since chrome closes when the last tab is closed, this effectively closes chrome without needing to send alt+f4. 
    send, ^w
WinWaitClose, YouTube on TV - Google Chrome ahk_class Chrome_WidgetWin_1 
return

Finally you can set the shortcut of control+alt+v andshift+escape within Advance MCE Remote Mapper to any key you like, I chose "Pictures" on my HP Remote and "visualisation" as my exit. You can use any key though.

Now you can add it to Advanced Launcher in Kodi and add it to the home screen as well as launching it from the remote.

I hope this helps someone as it has me. If you have any problems, post it here and I will try and sort it out for you.,
↯ Ω ☿
If I've helped you, dont forget to give me a like, Thanks 🤘
Reply
#2
https://9to5google.com/2019/09/16/youtub...bled-soon/
YouTube has offered a “leanback” experience that’s remote optimized on the web for a long time – nearly a decade, in fact. Now, it’s been revealed that this feature will be killed off in the near future.

looks like it will be the same as youtube plugin
“You are going to a criminally dangerous neighbourhood. Pirate sites are big businesses and exist solely to make money by robbing you, or worse. This is your cyber security is in danger and malware, blackmail and identity theft is common place.”
Reply
#3
(2020-03-03, 01:35)the_other_guy Wrote: https://9to5google.com/2019/09/16/youtub...bled-soon/
YouTube has offered a “leanback” experience that’s remote optimized on the web for a long time – nearly a decade, in fact. Now, it’s been revealed that this feature will be killed off in the near future.

looks like it will be the same as youtube plugin
go to youtube.com/tv on any browser, its already shutdown for pc usage. However on any smart tv, its still fully functional...just that its basically a web browser wrapper. That's what I figured out in doing this. We are tricking website into thinking its a samsung smart tv. Perhaps I am misunderstanding the meaning of your post? I offer this as an alternative to the YouTube plugin offered by the Kodi team. I always liked the Leanback experience of youtube. PLUS, as an added bonus, you can create a YouTubeKids launcher in a similar manner.
↯ Ω ☿
If I've helped you, dont forget to give me a like, Thanks 🤘
Reply
 
Thread Rating:
  • 1 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
Leanback YouTube on TV for PC on Chrome51
This forum uses Lukasz Tkacz MyBB addons.