OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Web applications => Topic started by: mauro on February 02, 2021, 11:57:12 pm
-
Good evening, I've just downloaded/installed ClipGrab 3.7.2 by his rpm package (ANPM).
It starts, but after pasted a youtube video link in the field for downloading, it warns that link is not a valid one for video contents.
Has it maybe become obsolete due to a Youtube platform update against video grabbing?
Thank you
-
Wouldn't be surprised if YouTube changed its API again. Also watch out for ampersands and such in the URL, IIRC you need to prune the ampersand and following text off.
-
Thank you for answering Dave, no amperstands appear in the URL
-
Hi,
The version you downloaded is a bit outdated unfortunately.
The newer version of clipgrab needs webenginewidgets and that we dont have yet.
So we need to wait till BWW have made it ready for us...
But donations, are welcome for BWW, so they can further work on QT5 and more OS/2 based projects ....
-
Hi,
The version you downloaded is a bit outdated unfortunately.
The newer version of clipgrab needs webenginewidgets and that we dont have yet.
So we need to wait till BWW have made it ready for us...
But donations, are welcome for BWW, so they can further work on QT5 and more OS/2 based projects ....
Understand, thank you
-
Hi,
I just compile the latest Clipgrab but unfortunately it wont work with OS2 anymore.
ClipGrab uses youtube-dl in order to download videos from the Internet
And the Os2 python dont work with youtube-dl
So for now its a no go, sorry :'(
-
Works here, after minor patching to disable CTYPES,
With a new clone from github,
K:\work\youtube-dl>python -m youtube_dl https://www.youtube.com/watch?v=JV7xHhvo
[youtube] JV7xHhvowGc: Downloading webpage
[download] Destination: taking Rubber band ball to pawn shop #shorts-JV7xHhvowGc
.f248.webm
[download] 100% of 18.23MiB in 00:1706MiB/s ETA 00:008
[download] Destination: taking Rubber band ball to pawn shop #shorts-JV7xHhvowGc.f251.webm
[download] 100% of 999.34KiB in 00:0013MiB/s ETA 00:001
[ffmpeg] Merging formats into "taking Rubber band ball to pawn shop #shorts-JV7xHhvowGc.webm"
Deleting original file taking Rubber band ball to pawn shop #shorts-JV7xHhvowGc.f248.webm (pass -k to keep)
Deleting original file taking Rubber band ball to pawn shop #shorts-JV7xHhvowGc.f251.webm (pass -k to keep)
Quick hack, needs work, likely just operating system changes like (if NT and !os2) but I have to look up the correct syntax.
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 8f65c6499..0018c1a4a 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -109,8 +109,8 @@ from .postprocessor import (
)
from .version import __version__
-if compat_os_name == 'nt':
- import ctypes
+#if compat_os_name == 'nt':
+# import ctypes
class YoutubeDL(object):
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py
index 6c3d49d45..d1a8feae6 100644
--- a/youtube_dl/compat.py
+++ b/youtube_dl/compat.py
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
import base64
import binascii
import collections
-import ctypes
+#import ctypes
import email
import getpass
import io
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 8e4d144c9..966d202eb 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -9,7 +9,7 @@ import calendar
import codecs
import collections
import contextlib
-import ctypes
+#import ctypes
import datetime
import email.utils
import email.header
@@ -3520,7 +3520,7 @@ def setproctitle(title):
# ctypes in Jython is not complete
# http://bugs.jython.org/issue2148
- if sys.platform.startswith('java'):
+ if sys.platform.startswith('os2'):
return
try:
And of course packaging.
-
Tried running make, which failed due to no pandoc installed. It did package it somewhat, but running the script gives weirdness,
H:\tmp>python youtube-dl
Usage: youtube-dl [OPTIONS] URL [URL...]
youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
H:\tmp>python youtube_dl https://www.youtube.com/watch?v=JV7xHhvowGc
W:\USR\BIN\python.exe: can't open file 'youtube_dl': [Errno 2] No such file or directory
Note that the script seems to be zipped or such,
H:\tmp>file youtube-dl
youtube-dl: a /usr/bin/env python script executable (binary data)
-
Anyways for now, here's the unpackaged youtube-dl. Unluckily it is very CPU intensive while loading, taking almost a minute on this I5 before it does anything.
Create a directory, yt-down or whatever. Unzip the file. run python -m youtube-dl url or python -m youtube-dl --help | less to see the possible options.
Also doesn't seem to like to run on an HPFS volume, so use a JFS volume
-
Hi Dave
Thankz, will look if this works with clipgrab :)
If i unzip it and run
E:\GCC\youtube-dl>python -m youtube-dl
C:/USR/BIN/python.exe: No module named youtube-dl
-
Did you run it in the parent of the youtube-dl subdirectory? E:\GCC in your case.
-
TeLLie,
...If i unzip it and run
E:\GCC\youtube-dl>python -m youtube-dl
C:/USR/BIN/python.exe: No module named youtube-dl
I think the proper module name to run is actually 'YoutubeDL.py', at least that's what Dave has in his bundle...unless of course 'youtube-dl' is actually a clipgrab module name...not sure as I do not have clipgrab instaled here.
-
TeLLie,
...If i unzip it and run
E:\GCC\youtube-dl>python -m youtube-dl
C:/USR/BIN/python.exe: No module named youtube-dl
I think the proper module name to run is actually 'YoutubeDL.py', at least that's what Dave has in his bundle...unless of course 'youtube-dl' is actually a clipgrab module name...not sure as I do not have clipgrab instaled here.
It's the whole subdirectory that needs to be run, not an individual file. As I said, it is unpackaged and packaging should create a binary script holding the subdirectory and documentation.
-
Hi Dave,
I used youtube-dl all the time till i saw you called it youtube_dl :)
Now its working
E:\GCC\youtube-dl>python -m youtube_dl https://www.youtube.com/watch?v=U4_RFEY5WDA
[youtube] U4_RFEY5WDA: Downloading webpage
[download] Destination: Lady Gaga - Million Reasons _ Yoü and I _ The Edge of Glory live at One America Appeal-U4_RFEY5WDA.f136.mp4
[download] 100% of 72.14MiB in 00:07
[download] Destination: Lady Gaga - Million Reasons _ Yoü and I _ The Edge of Glory live at One America Appeal-U4_RFEY5WDA.f140.m4a
[download] 100% of 20.38MiB in 00:02
[ffmpeg] Merging formats into "Lady Gaga - Million Reasons _ Yoü and I _ The Edge of Glory live at One America Appeal-U4_RFEY5WDA.mp4"
Btw: python3 is much faster to use...
-
Yea, it looks like I screwed up with directions, the underline is correct. Good that it is working for you and I see you're getting good download speeds.
-
Btw: python3 is much faster to use...
My python3 build presumably? I should update it - I think with some fixes to readline, that readline.pyd should work now...
-
Hi Paul,
Sorry i should mention this.
Yes its you're python3 build :)
-
Btw: python3 is much faster to use...
My python3 build presumably? I should update it - I think with some fixes to readline, that readline.pyd should work now...
Can you remind me of its URL?
-
Hi Dave,
..It's the whole subdirectory that needs to be run, not an individual file. As I said, it is unpackaged and packaging should create a binary script holding the subdirectory and documentation...
Yup, I got it now...works great here!
So is this update something that's meant to be run from within clipgrab? Sorry, it may be obvious to those who have done it, I haven't run clipgrab in a while so before I go off installing it I figured I better ask first.
Thanks!
-
Btw: python3 is much faster to use...
My python3 build presumably? I should update it - I think with some fixes to readline, that readline.pyd should work now...
Can you remind me of its URL?
See thread at https://www.os2world.com/forum/index.php/topic,2484.30.html
-
Great, Python3 works much better then Python2 for youtube-dl, no patching to avoid the CTYPES error needed, much faster.
The script can be downloaded at https://youtube-dl.org/ (https://youtube-dl.org/), if you get the complete tar.gz, just extract the youtube-dl binary from the top folder of the package and run it. Generally the URL may need quoting with double quotes.
-
Hi Dave,
..It's the whole subdirectory that needs to be run, not an individual file. As I said, it is unpackaged and packaging should create a binary script holding the subdirectory and documentation...
Yup, I got it now...works great here!
So is this update something that's meant to be run from within clipgrab? Sorry, it may be obvious to those who have done it, I haven't run clipgrab in a while so before I go off installing it I figured I better ask first.
Thanks!
Actually it is the recommended way to download videos with clipgrab being a frontend. See https://youtube-dl.org/ (https://youtube-dl.org/) and in particular the Documentation link to get an idea of its power.
Basically running python3 youtube-dl "URL" will download the video referenced in the URL and use FFmpeg to assemble the video and audio into a container that'll play in vlc, mplayer etc. Being Canadian, you can also legally use it to download music, without the video, from YouTube.
Note that the URL should generally be quoted with double quotes to work around shell characters such as ? or &
edit, simple way to get the script/binary,
wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
Adjust the path as needed after the -O