Release [RELEASE] context.youtube.dl.menu (Context menu + button to download Youtube videos)
#16
Noted, thank you.

Any way to incorporate your script into kodi (Coreelec) so that it does an auto update of the core at startup or when triggered? I didnt understand how to use it.
Reply
#17
I saw this guide- https://discourse.coreelec.org/t/tutoria...eelec/4255

I made a scripts folder in .config and put the script in it

I modified the 2nd line, thus the script now reads as below

Code:
#!/bin/sh
cd /storage/.kodi/addons/script.module.youtube.dl/lib
rm -rf youtube_dl-old
mkdir tmp
cd tmp
git clone https://github.com/rg3/youtube-dl.git
mv ../youtube_dl ../youtube_dl-old
mv youtube-dl/youtube_dl ..
cd ..
rm -rf tmp
ls -la
chown kodi.kodi youtube_dl
python -m youtube_dl --version

When I run the script I get the errors:

Code:
/storage/scripts/youtubedl.sh: line 6: git: not found
mv: can't rename 'youtube-dl/youtube_dl': No such file or directory
total 46
drwxr-xr-x    4 root     root          1024 May 21 15:04 .
drwxr-xr-x    4 root     root          1024 May 21 14:44 ..
-rw-r--r--    1 root     root         16085 May 21 14:44 YDStreamExtractor.py
-rw-r--r--    1 root     root          9198 May 21 14:44 YDStreamUtils.py
-rw-r--r--    1 root     root         11448 May 21 14:44 YoutubeDLWrapper.py
-rw-r--r--    1 root     root            13 May 21 14:44 __init__.py
-rw-r--r--    1 root     root          3788 May 21 14:44 main.py
drwxr-xr-x    2 root     root          1024 May 21 14:44 yd_private_libs
drwxr-xr-x    5 root     root          1024 May 21 14:44 youtube_dl-old
chown: unknown user/group kodi:kodi
/usr/bin/python: No module named youtube_dl


Please help
Reply
#18
You'll need to install git on your distribution for this script to work. I don't know coreelec and what distro it's based on to give any advice on how to do that. The script itself seems to have worked in principle, but as git was missing, it broke halfway through and renamed the youtube_dl folder of the youtubedl control addon to youtube_dl-old as a backup. As it couldn't download the latest version without git, it effectively broke the youtubedl control addon for you right now.

Please figure out how to install git, then run the script again.

As for integrating this into my addon,... That won't happen for various reasons. Each system is different and I would be messing with a different addon on a system level. That's not what my addon is for or what it should do. The youtubedl control addon dev could or might be able to build an update function into his addon to keep his addon up to date and save him from having to release updates every time the core script gets updated.

Having said that, at this point we still don't know if the issues with downloading are caused by an old version of the core at all or if there's something wrong with your setup or network.
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#19
Updating the youtube-dl module does the job. The only glitch now is that the downloaded video wont move to the desired download folder and stays in temp. In fact even if i set the download directory to temp the error message still pops up!
Reply
#20
Tongue 
(2019-02-17, 14:34)AnonTester Wrote: While the youtube-dl control addon has functionality to download streams, I found it to be very slow and it requires remote control like Yatse or similar to send commands to Kodi to access the download controls.
I wanted to be able to just have a context menu entry to download YouTube videos while in the Youtube addon or any other addon using youtube as source or even from favorites. I also wanted the option to have a download button while a video is playing. This addon attempts to do just that.

In order to download the highest quality video & audio (1080p and higher), it requires ffmpeg or avconv to be installed on a system level. Youtube uses separate audio and video streams for those high quality and to combine the separate streams into a single file, ffmpeg or avconv is required. The addon falls back gracefully to obtain the best single stream containing both video & audio from youtube (max 720p) if neither ffmpeg or avconv binaries are available.
Note: Android systems will not be able to download high-quality streams with this addon.

This addon has configuration options to run as a service and patch the currently installed Kodi theme to add a red record button to the On Screen Display (OSD) while playing videos. This needs to be enabled if you wish to have that button, without it, you can only download videos using the default context menu.

To install:
- download my repository https://github.com/AnonTester/kodi-repo/...-1.0.0.zip
- Kodi → Addons → Addon Browser → Install from zip file → repository.anontester-1.0.0.zip
- Kodi → Addons → Addon Browser → Install from repository → Wuff's Repository → Context Menus → Youtube dl Context Menu → install
- Then enable it via Add-ons → My Add-ons → Context Menus → Youtube dl Context Menu → Enable
- Configuration option: enable the OSD button (if desired)

Requirements:
- Youtube-dl control addon
- ffmpeg or avconv system binaries (for merging high quality streams)

This addon was developed on Kodi 18 on Linux and is working for me. If you encounter any issues, provide debug logs and I'll look into it!

Greetings,


I am a totally new to Kodi still, 2 days (not to Linux and programming) and from my understanding of your module description that's exactly what I need/look for to pimp my experience.

But if I understand properly you are only adding that extra OSD button when playing a Youtube video right? I suppose when using the Youtube video addon? (I am not using that).
However I am using youtube-dl control to download currently playing streams, it does not matter if they are youtube videos actually, and for the moment I have to exit full screen get back to home, then go on the Youtube-dl addon to open it, and then press 'Download current playing video', which can be quite a pain if I could simply add a button to do that straight from the video playing.

I have not looked at your code yet, but I suppose tweaking the theme general full screen and OSD xml files manually would be required to achieve that or maybe add the addons I want the OSD to work on somewhere. Atm I'd like for sure add it to 'Catch Up TV and More' but maybe later I will want to add it somewhere else.

So if you could give me some pointers to avoid me from trial/fail/crash-test method I would greatly appreciate Wink

I am using:
LibreELEC (official): 9.2.3 (RPi4.arm)
Theme confluence.

Thanks for your work!

Regards.
Reply
#21
@Muad.Dib yes, my addon is specifically for youtube, but if you peek at the code specifically at service.py, you'll see how it patches the current kodi skin to add the 'record' button in the VideoOSD.xml and Variables.xml files. You'll need to replace the onclick command to the particular function of the youtube-dl control to save the stream or to open up the options menu.

@extremeaudio There's something odd going on with the VFS module in Kodi - at least in the alpha 19 branch. Saving on a remote share (whether Samba or NFS) stalls for whatever reason. I've resolved on my system to mount a remote share on the system level itself rather than through kodi and that works better. I've made various adjustments while trying to solve this and will release a new version soon. I just need to do some more testing and remove some debugging code Smile
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#22
Wink 
(2020-06-15, 18:45)AnonTester Wrote: @Muad.Dib yes, my addon is specifically for youtube, but if you peek at the code specifically at service.py, you'll see how it patches the current kodi skin to add the 'record' button in the VideoOSD.xml and Variables.xml files. You'll need to replace the onclick command to the particular function of the youtube-dl control to save the stream or to open up the options menu.

Many thanks for help and suggestions. I will definitely have look into it when I have time to see how this works.
I'll get back here to let you know of my progress ( or not Wink ).

Cheers!
Reply
#23
I've just uploaded v1.2.1 to my github here https://github.com/AnonTester/context.youtube.dl.menu
It's not in the repository yet (repo version 1.1.6) as it needs testing. It works on the latest Kodi 19 nightly (20200701) and should still work on Kodi 18, but as I do not have a Kodi 18 installation, I don't know if I missed anything... If you get any errors or if something isn't working, please send a debug log, I can't do anything without it.

Changelog:
1.2.1 (2020-07-03)
------------------
- Remove non-existing info fields from playlist download function

1.2.0 (2020-06-27)
------------------
- Remove python requirement, reinstating backwards compatibility
- Further changes to copy method, but Kodi NFS/SMB stalls randomly during copy. Best to use system mounted target path!
- Change default filename template to include year and separate format with dot
- Add option to set max video resolution to download (default 1080p)
- Fix error notification when target path not writeable
- Improve retry loop on move error
- Add menu entry to download all videos of playlists
- Fix youtube-dl core info context item not working
- Add menu entry for youtube-dl context menu settings
- Add option to download videos or playlists into uploader directory (default off)
- Add options to add upload year and resolution to filename (default on)
- Fix failed move due to format extension not identified properly in newer ffmpeg versions
- Add option to remove variants of 'Official Music Video' from filename (default on)

1.1.7 (2020-03-15)
------------------
- Added alternative file copy method when xbmc.vfscopy fails
- bump python requirement to 3.0.0 as now required by Kodi 19. This breaks backwards compatibility!
- Improved error handling when video not available
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#24
(2020-07-01, 23:28)AnonTester Wrote: I've just uploaded v1.2.1 to my github here https://github.com/AnonTester/context.youtube.dl.menu
It's not in the repository yet (repo version 1.1.6) as it needs testing. It works on the latest Kodi 19 nightly (20200701) and should still work on Kodi 18, but as I do not have a Kodi 18 installation, I don't know if I missed anything... If you get any errors or if something isn't working, please send a debug log, I can't do anything without it.

Changelog:
1.2.1 (2020-07-03)
------------------
Hi there !

Just downloaded your v1.2.4. Looks like a nice clean job from description ...

How would you compare with:
https://github.com/anxdpanic/context.youtube.download
(Nov'17.)
Reply
#25
@siliconhippy thanks. I wasn't aware of Anxdpanic's addon... That would've given me a good starting point back then.

From what I see glancing at the code, it's not Kodi19 compatible, has no own settings and it adds dl options to the context menu of youtube items and hasn't received any updates in 3 years, so it may be feature-complete for Anxdpanic's purpose or no longer in use.
I started writing my addon because I primarily wanted to have a 'record' button in the OSD while playing a youtube video and added the other context menu functions later. My addon doesn't have 'audio only' download options but might get added at some point.

Ultimately, both addons interface with the youtube-dl control addon which is a wrapper for youtube-dl.

It's up to you and your preferences and Kodi version. Give both a try and decide for yourself or use both, it doesn't have to be one or the other Smile
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#26
(2020-09-08, 23:29)AnonTester Wrote: @siliconhippy thanks. I wasn't aware of Anxdpanic's addon... That would've given me a good starting point back then.


It's up to you and your preferences and Kodi version. Give both a try and decide for yourself or use both, it doesn't have to be one or the other Smile
Thanks !
I will try yours...
Reply
#27
Due to changes in the logging of Kodi19 nightly, I pushed an update to v1.2.5 last night, however, the youtube-dl control addon itself has not been adjusted yet. I submitted a PR and also updated it to the latest youtube-dl core: https://github.com/ruuk/script.module.yo...dl/pull/60
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#28
Hello, I have Kodi 18.9 on Windows and have successfeully installed your repo and addon. but I get import errors on using:
https://paste.kodi.tv/raw/wonawonice
do you have an idea for fix this error?
Reply
#29
(2021-01-17, 16:53)vbprofi Wrote: Hello, I have Kodi 18.9 on Windows and have successfeully installed your repo and addon. but I get import errors on using:
https://paste.kodi.tv/raw/wonawonice
do you have an idea for fix this error?

I'm using Kodi19 myself which uses Python3 whereas Kodi 18 uses Python2 and quite a lot is different between Python 2 and 3. I'll set up a test install and take a look what needs to be changed for Kodi18.
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply
#30
Not as simple as I hoped. I seem to have broken backwards compatibility at some point and nobody noticed.
Given that the first Release Candidate of Kodi 19 is available now and I don't have much spare time at the moment, I'm sorry, but I won't fix this. You can try the older versions
https://github.com/AnonTester/kodi-repo/...be.dl.menu
Got an error message or something not working as it should? Provide a full Debug log (wiki) via paste.kodi.tv
Reply

Logout Mark Read Team Forum Stats Members Help
[RELEASE] context.youtube.dl.menu (Context menu + button to download Youtube videos)0