OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Neil Waldhauer on May 09, 2022, 07:14:02 pm

Title: Media-downloader
Post by: Neil Waldhauer on May 09, 2022, 07:14:02 pm
I saw the news about Media-downloader, but I don't really understand how to install it.

I used 7z to make a mediadownloader folder, and when I run media-downloader.exe, I get a bunch of notices.

I found and installed ffmpeg using ANPM, so that was one message. Here are the rest.

Code: [Select]
[media-downloader] *****************************************************
[media-downloader] To Disable These Checks, Do The Following:-
[media-downloader] 1. Go To "Configure" Tab.
[media-downloader] 2. Go To "General Options" Sub Tab.
[media-downloader] 3. Uncheck "Show Version Info When Starting".
[media-downloader] *****************************************************
[media-downloader] Failed to find executable "aria2c"
[media-downloader] Failed to find executable "stdbuf"
[media-downloader] Error, executable to backend "aria2c" could not be found
[media-downloader] Failed to find executable "aria2c"
[media-downloader] Error, executable to backend "aria2c" could not be found
[media-downloader] Checking installed version of yt-dlp
[media-downloader] Failed to find version information, make sure "yt-dlp" is installed and works properly
[media-downloader] Checking installed version of ffmpeg
[media-downloader] Found version: 4.2.2

How can I fix the rest of these messages?
Title: Re: Media-downloader
Post by: David McKenna on May 09, 2022, 11:35:06 pm
Hi Neil,

  I tried the media-downloader and got the 'aria2c not found' message too. A quick google showed that aria2c is some type of command line web media downloader executable (kinda like 'curl' I guess) that we don't have a port of. So 'Media-downloader' is probably supposed to be a 'front end' to that, but without aria2c kinda useless...

Regards,
Title: Re: Media-downloader
Post by: Dave Yeo on May 09, 2022, 11:49:16 pm
It might work with just yt-dlp, a fork of youtube-dl IIRC. If nothing else you could use it on the command line, python yt-dlp https:youtube.com/path/tovideo or such.
https://github.com/yt-dlp/yt-dlp (https://github.com/yt-dlp/yt-dlp)
Note that with youtube-dl, I had to disable CTYPES or such.
Title: Re: Media-downloader
Post by: Martin Iturbide on May 10, 2022, 01:56:05 am
Hi

I'm guessing hard here, but I think in my case it needs phyton3. phyton3 is only on the exp repository as I can see.
Neil are you using "netlabs-exp" on that machine?

I will keep trying.

Regards
Title: Re: Media-downloader
Post by: David McKenna on May 10, 2022, 02:18:53 am
 Hi Martin,

  You are probably correct - the only error I see when starting media-downloader is about aria2c, and I do have Python3 installed (it was very difficult to install for me). But even so, I can't do anything with media-downloader - everything is greyed-out and not working...

Regards,
Title: Re: Media-downloader
Post by: Martin Iturbide on May 10, 2022, 02:54:03 am
Hi

I'm having a lot of problems to install python3 on a new ArcaOS 5.0.7 I created. A lot of errrors with "yum". I can no longer install media-downloader.

I remember that I run media-dowloader before and let it run for a while until it downloads yt-dlp by itself. But sadly I can not longer test it on this VM.

Regards
Title: Re: Media-downloader
Post by: Dave Yeo on May 10, 2022, 04:11:55 am
Hi Martin, you need to update Python on netlabs-rel before enabling netlabs-exp

Hi David, media-downloader seems broken when it comes to downloading yt-dlp. Use wget to download it from the URL shown in media-downloader to the directory also shown in media-downloader, here F:/home/dave/.local/share/media-downloader/bin and restart media-downloader, which I had to kill here as it didn't want to exit.
Test yt-dlp before restarting by running it as python yt-dlp --version or --help or giving it a youtube URL, eg "python yt-dlp https://www.youtube.com/watch?v=QJFFUT_WWpI"
Media-downloader does seem broken here hanging with,
Code: [Select]
[media-downloader] cmd: "f:/Home/dave/.local/share/media-downloader/bin/yt-dlp" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "--progress-template" "download:[download] %(progress._percent_str)s of %(progress._total_bytes_str)s at %(progress._speed_str)s ETA %(progress._eta_str)s" "--progress-template" "postprocess:DoneDownloading" "https://www.youtube.com/watch?v=QJFFUT_WWpI"
[code]
Title: Re: Media-downloader
Post by: Dave Yeo on May 10, 2022, 04:41:02 am
OK, I think one problem is that media-downloader expects yt-dlp to be executable.
Copy it to yt-dlp.cmd and at the top of the file add
Code: [Select]
extproc k:\usr\bin\python.exe
adjust path to where your python is installed, perhaps c:\usr\bin\python.exe
Now it almost runs, with python failing like this,
Code: [Select]
[media-downloader] cmd: "f:/Home/dave/.local/share/media-downloader/bin/yt-dlp.cmd" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "--progress-template" "download:[download] %(progress._percent_str)s of %(progress._total_bytes_str)s at %(progress._speed_str)s ETA %(progress._eta_str)s" "--progress-template" "postprocess:DoneDownloading" "https://www.youtube.com/watch?v=QJFFUT_WWpI"
k:\usr\bin\python.exe: can't open file 'F:/home/dave/yt-dlp.cmd': [Errno 2] No such file or directory

Seems python can't get past .local, on *nix a leading dot makes a file hidden, so we copy yt-dlp.cmd to %HOME% or f:\home\dave here and we get,
Code: [Select]
[media-downloader] cmd: "f:/Home/dave/.local/share/media-downloader/bin/yt-dlp.cmd" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "--progress-template" "download:[download] %(progress._percent_str)s of %(progress._total_bytes_str)s at %(progress._speed_str)s ETA %(progress._eta_str)s" "--progress-template" "postprocess:DoneDownloading" "https://www.youtube.com/watch?v=QJFFUT_WWpI"
[youtube] QJFFUT_WWpI: Downloading webpage
[youtube] QJFFUT_WWpI: Downloading android player API JSON
[info] QJFFUT_WWpI: Downloading 1 format(s): 248+251
[download] Destination: Ladyva - Quarantine Boogie-QJFFUT_WWpI.f248.webm
[download] 100% of 38.28MiB at NA ETA NA
[download] Destination: Ladyva - Quarantine Boogie-QJFFUT_WWpI.f251.webm
[download] 100% of 1.78MiB at NA ETA NA
[media-downloader] Done downloading
[Merger] Merging formats into "Ladyva - Quarantine Boogie-QJFFUT_WWpI.webm"

So I guess Python has a bug with directories with a leading dot not being seen or perhaps expected behaviour.

Edit, quit now works here.

Edit:
Code: [Select]
extproc %UNIXROOT%\usr\bin\python.exeworks as well for yt-dlp.cmd and is portable.


Title: Re: Media-downloader
Post by: TeLLie on May 10, 2022, 10:37:19 pm
Hi all

You need to download the youtube and the yt-dlp it takes sometimes to get it download
Also python3 is needed
For me those 2 engines workes
[media-downloader] *****************************************************
[media-downloader] To Disable These Checks, Do The Following:-
[media-downloader] 1. Go To "Configure" Tab.
[media-downloader] 2. Go To "General Options" Sub Tab.
[media-downloader] 3. Uncheck "Show Version Info When Starting".
[media-downloader] *****************************************************
[media-downloader] Failed to find executable "aria2c"
[media-downloader] Error, executable to backend "aria2c" could not be found
[media-downloader] Checking installed version of yt-dlp
[media-downloader] Found version: 2022.04.08
[media-downloader] Checking installed version of wget
[media-downloader] Found version: 1.20.3
[media-downloader] Checking installed version of youtube-dl
[media-downloader] Found version: 2021.12.17
[media-downloader] Checking installed version of yt-dlp-ffmpeg
[media-downloader] Found version: 2022.04.08
[media-downloader] Checking installed version of ffmpeg
[media-downloader] Found version: 4.2.2
[media-downloader] cmd: "C:/Home/.local/share/media-downloader/bin/youtube-dl" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "https://www.youtube.com/watch?v=5b2eJweOY10"
[youtube] 5b2eJweOY10: Downloading webpage
[youtube] Downloading just video 5b2eJweOY10 because of --no-playlist
[download] Destination: Zo gaat S10 om met podiumblunder Songfestival-5b2eJweOY10.f137.mp4
[download]   8.5% of 40.75MiB at 50.93KiB/s ETA 12:29


Like Dave say there is some trouble with the python3 charmap
RROR: 'charmap' codec can't encode character '\u3010' in position 0: character maps to <undefined>

I have some files downloaded with yl-dlp

But most would be downloaded ok with youtube
Title: Re: Media-downloader
Post by: David McKenna on May 10, 2022, 10:52:43 pm
 Hi Tellie,

 I get this:

[media-downloader] *****************************************************
[media-downloader] To Disable These Checks, Do The Following:-
[media-downloader] 1. Go To "Configure" Tab.
[media-downloader] 2. Go To "General Options" Sub Tab.
[media-downloader] 3. Uncheck "Show Version Info When Starting".
[media-downloader] *****************************************************
[media-downloader] Failed to find executable "aria2c"
[media-downloader] Error, executable to backend "aria2c" could not be found
[media-downloader] Start Downloading yt-dlp ... ... ...
[media-downloader] Downloading: https://github.com/yt-dlp/yt-dlp/releases/download/2022.03.08/yt-dlp
[media-downloader] Destination: D:/HOME/.local/share/media-downloader/bin/yt-dlp.tmp

 and it just sits there forever. yt-dlp.tmp is 0 bytes. Could it be because my 'Home' directory is on a different drive from my %UNIXROOT%?

Regards,

EDIT: wait a minute - I let it sit for a half hour, then it actually downloaded something and now appears to have some functions! Gotta try it out...
Title: Re: Media-downloader
Post by: David McKenna on May 10, 2022, 11:01:45 pm
 Hi Martin,

  In theory, you should be able to install all versions of python by opening a command prompt window and typing:

yum update python

  But when I did that, I got a massive amount of errors. ANPM did not work either - errors. The way I got it to update (after weeks of messing around) was to open ANPM, go to 'Manage'->'Repositories' and disable every repository (right click on one, then choose 'disable') EXCEPT netlabs-exp, then close ANPM. Then open a command prompt and type:

yum update python

 It worked! Of course, re-enable the repositories after trying this. I can't tell you it will work for you because I don't even know why it worked for me, but it did:

[C:\]python
Python 3.9.5 (default, Feb 21 2022, 12:29:29)
[GCC 9.2.0 20190812 (OS/2 RPM build 9.2.0-5.oc00)] on os2knix
Type "help", "copyright", "credits" or "license" for more information.
>>>

 Regards,
Title: Re: Media-downloader
Post by: Martin Iturbide on March 05, 2023, 04:20:20 pm
Hi

FYI and also as note to myself  ;D

Tellie ported Media Downloader 2.9.0
- ftp://ftp.netlabs.org/pub/qtapps/media-downloader-os2-2.9.0.7z

Just some notes to make it run:
- This run with python 3 that is on Netlabs-exp. According to some suggestion you need to remove netlabs-rel and just leave netlabs-exp to don't have issues installing python.
- Check the readme file
- Update first the "NetworkTimeOutInSeconds=300" on the program config file (read the readme)
- Run the program and wait for it to download yt-dlp
- Config the program on "Configure - Engine's default option". (read the readme).
- Test downloading a video from YouTube

If you got an error with yt-dlp reported on the program it will be good to test yt-dlp phyton script.
- After it downloaded yt-dlp. Go to "C:\home\.local\share\media-downloader\bin" and run "python yt-dlp --version" just to see if python is working fine with yt-dlp.
- If you get an error, you may have some version problems with python. 

Now Media-downloader is working for me.

Regards


Title: Re: Media-downloader
Post by: Martin Iturbide on August 29, 2023, 09:17:06 pm
Hello

Tellie updated Media-Downloader:
ftp://ftp.netlabs.org/pub/qtapps/media-downloader-3.3.0-os2.7z

I will check how to make it run and if there is any change from the latest version on the instructions.

Regards
Title: Re: Media-downloader
Post by: Martin Iturbide on October 01, 2023, 02:57:05 pm
Hello

Tellie updated Media-Downloader:
ftp://ftp.netlabs.org/pub/qtapps/media-downloader-3.3.0-os2.7z

I will check how to make it run and if there is any change from the latest version on the instructions.

Regards

Hello, I got back to this subject. It finally worked here on my ArcaOS 5.1.0 VM.

1) You need to pull the trick to install python 2.7 and python 3. Ref: https://mantis.arcanoae.com/view.php?id=3523
- In ANPM I went to "Available - RPM"
- I selected "python2.7", "python3", "python-unversioned-command" and run "Install".

2) Following the old "Media-Downloader" readme:
Quote
n OS2 we cant have utf8 filenames, and we need to stick with ascii, that's why we need to add --restrict-filenames

Go to Configure tab.
Go to Engines's Default Options tab.
At the Engine's Name drop down list, select an engine you want to change its option.
At the "Options To Add" text field, add  --newline --ignore-config --no-playlist --restrict-filenames -o %(title).200s-%(id)s.%(ext)s
Click Add.
Right click the newly added entry and then select Set As Default.

And it worked for me, it downloaded the "yt-dlp runtime" automatically, and I was able to get a YouTube Video downloaded.

But on this version I can not longer find the "media-downloader.conf" to add "NetworkTimeOutInSeconds=300". But it worked for me.

Regards
Title: Re: Media-downloader
Post by: TeLLie on October 01, 2023, 05:48:59 pm
Hi,
It should be in..
C:\Home\.local\share\media-downloader\settings\settings.ini
NetworkTimeOutInSeconds=300