Kodi Community Forum

Full Version: YouTube
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You're probably having the same issue that I listed (previous page in this forum):

"I downloaded the new "video_info.py" and installed it on my X86-based unit  (LibreElec 10.0.4   Kodi 19.5 Matrix  Youtube 6.8.25+matrix.1) and rebooted.

The "Video not available on this app" issue was resolved,  BUT,  certain videos are erroring with the text "This Video is unavailable".

Though, you can view the videos that return that error via a web browser..  (  https://www.youtube.com/watch?v=guXMb7zLblM  ) "

https://paste.kodi.tv/ugekucupar.kodi
You can try this patch. Please, keep in mind, there are two files in different folders. Unpack them into appropriate places and restart Kodi. I tried Your file in problem and it was playing for me flawlessly. Also, I should warn You, I test patch on Leia (Kodi 18), not on Matrix, so I'm not sure it will work for You, so I would backup Your existing files
(2023-05-01, 22:53)StrangeAlien Wrote: [ -> ]You can try this patch. Please, keep in mind, there are two files in different folders. Unpack them into appropriate places and restart Kodi. I tried Your file in problem and it was playing for me flawlessly. Also, I should warn You, I test patch on Leia (Kodi 18), not on Matrix, so I'm not sure it will work for You, so I would backup Your existing files
OK, 

1. Is the video_info.py the same as before, or updated?
2. Where does /signature/cipher.py go (filepath) ?
1. It's different one
2. It's subfolder of "helper" folder where "video_info.py" located

I.e., if "video_info.py" located in addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper,
"cipher.py" located in addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/signature
FIY, "signature" located in "helper" already, so just unpack zip into "helper" is enough
@StrangeAlien

Thanks ! I am sure many will try and give feedback  Cool
How can I trigger "Mark Watched" on a video with a single button press on my remote ?

I know, I know ... an unusual question ... (i.e. not trying to resolve playback issues  Tongue )

In a regular Kodi library list view I would send the "w" keypress (this is in the default keymap), a shortcut to the same function in the context menu - it triggers the action ToggleWatched "Marked as watched / unwatched" via setPlaycount()
Though it's called a count, it doesn't increment with every play, but rather it's treated like a boolean, 0=unwatched, 1=watched

However, the Youtube plugin is using a kinda/sorta/not-really "real" pseudo library list view, which makes sense when you consider it's not working with "normal" video library items, but stream URLs.
This means that it needs to append extra entries in the context menus to do equivalent functions on these "not real video" items - hence the extra "Mark watched" as well as the inbuilt "Mark as watched" function.
It triggers the python routine YouTube('plugin://plugin.video.youtube/playback_history/', '-1', '?video_id=ABC123def456&action=mark_watched') 

So - can you think of a way to map this functionality to a single button-press-equivalent ?
Alternatively - ugly brute force method, how can I send the sequence of button equivalents : menu, down, down, down, down, Select ?

Advice/suggestions welcome if you can think of a better way to achieve this, or if I'm coming at this in a wrong-headed way.
(2023-05-02, 00:29)kurai Wrote: [ -> ]How can I trigger "Mark Watched" on a video with a single button press on my remote ?

I know, I know ... an unusual question ... (i.e. not trying to resolve playback issues  Tongue )

In a regular Kodi library list view I would send the "w" keypress (this is in the default keymap), a shortcut to the same function in the context menu - it triggers the action ToggleWatched "Marked as watched / unwatched" via setPlaycount()
Though it's called a count, it doesn't increment with every play, but rather it's treated like a boolean, 0=unwatched, 1=watched

However, the Youtube plugin is using a kinda/sorta/not-really "real" pseudo library list view, which makes sense when you consider it's not working with "normal" video library items, but stream URLs.
This means that it needs to append extra entries in the context menus to do equivalent functions on these "not real video" items - hence the extra "Mark watched" as well as the inbuilt "Mark as watched" function.
It triggers the python routine YouTube('plugin://plugin.video.youtube/playback_history/', '-1', '?video_id=ABC123def456&action=mark_watched') 

So - can you think of a way to map this functionality to a single button-press-equivalent ?
Alternatively - ugly brute force method, how can I send the sequence of button equivalents : menu, down, down, down, down, Select ?

Advice/suggestions welcome if you can think of a better way to achieve this, or if I'm coming at this in a wrong-headed way.
You know that if you long press the enter/OK  on your remote it will open the context menu and then you can toggle watched /unwatched ... given that's 2 steps but wayyy easier then trying to remap commands to a button on the remote.
If you definitely need to do it then the only way I know is by using Logitech Harmony Elite ', it's software makes it extremely easy to map a command to a physical or a non physical button on the remote LCD screen. This is what I use personally and would highly recommend it . ! 
Click This For The Forum link To Set Up
A youtube video showing how its done Here
(2023-05-02, 02:00)shaktoo Wrote: [ -> ]You know that if you long press the enter/OK  on your remote it will open the context menu and then you can toggle watched /unwatched ... given that's 2 steps but wayyy easier then trying to remap commands to a button on the remote.
If you definitely need to do it then the only way I know is by using Logitech Harmony Elite ', it's software makes it extremely easy to map a command to a physical or a non physical button on the remote LCD screen. This is what I use personally and would highly recommend it . ! 
Click This For The Forum link To Set Up

Immediately after hitting Post Reply I remembered that you can trigger scripts directly from keymap Cool ... so ...

/storage/.kodi/userdata/markwatched.py
Code:
import xbmc

xbmc.executebuiltin("Action(ContextMenu)")
xbmc.executebuiltin("Action(Down)")
xbmc.executebuiltin("Action(Down)")
xbmc.executebuiltin("Action(Down)")
xbmc.executebuiltin("Action(Down)")
xbmc.executebuiltin("Action(Select)")
and call it from
keymap.xml
Code:

<remote>
      <record>RunScript(special://masterprofile/markwatched.py)</record>
<remote>

Works beautifully and means I don't have to do any of the foolish messing around with interkey delays from my original reply.
Sometimes just formulating an answer to someone else lets your brain work out a better alternative in the background Smile



Edit: Ignore all this long-winded waffling from my original reply that I've shoved into the code box - the above above solution made it all irrelevant :/
Code:
Yes, I'm aware of the <$key mod="longpress">command</$key> keymap function.  Unfortunately it doesn't really help anything in this instance.  Using the longpress/OK gets me to exactly the same place as just using the shortpress/Menu button - i.e. at the top of the context menu.  The rest of the keysend sequence still needs to happen, manually or macroed.

I've been using Harmony remotes in their various flavours for many, many years.  Currently on the Harmony Companion/Home Control - the one that works via RF to the Hub, and has the IoT keys.  The button mapping is customised to hell and back, and my Kodi keymap does all sorts of different things depending on the Kodi context Smile

My current kludgy work-around in the Harmony button customisation is mapping a Menu->Down->Down->Down->Down->OK sequence to the otherwise mostly unused Record button.  (i.e. the ugly brute-force method I mention in original post).
It's not ideal because the inter-key send delay can only be set globally for the remote - there needs to be a balance between making all the *other* multi-send commands, like scrolling or volume -/+, waaaaaay too fast and sending the Mark-Watched sequence painfully slowly - slower than I can do just pressing the buttons manually.  It also can't be made Kodi context-aware via keymap because that only supports individual keysends, not sequences. 
Any time I try to play a YouTube video on Kodi, particularly a trailer, I get an error saying “The following content is not available on this app”. Is there a workaround/fix yet for this? Thanks.
(2023-05-03, 00:23)pauls156 Wrote: [ -> ]Any time I try to play a YouTube video on Kodi, particularly a trailer, I get an error saying “The following content is not available on this app”. Is there a workaround/fix yet for this? Thanks.

Install the latest version of the YouTube Addon here: Latest YouTube Addons

Made sure you choose the correct one for you version of Kodi.

These will be added to the Kodi Repository for updating the YouTube Addon soon, I think, if you want to wait.
Thank you. How do I do it on Android tv? Thanks!
(2023-05-03, 01:42)pauls156 Wrote: [ -> ]Thank you. How do I do it on Android tv? Thanks!
Are you running Kodi? If so, which version?

Have you ever installed addons?
Newest version of Kodi on Android TV. Yes to add ons. From the addon repository. Newest version of YouTube from the repository is installed.
(2023-05-03, 02:11)pauls156 Wrote: [ -> ]Newest version of Kodi on Android TV. Yes to add ons. From the addon repository. Newest version of YouTube from the repository is installed.
What version of the YouTube Addon are you using?

What is your exact version of Kodi?

Can you plug in a USB Thumb Drive and access the addon zip file from within Kodi?