Stand-alone youtube-dl works without Python installed

Browsers, email, chat, etc.
Post Reply
Message
Author
User avatar
nqb648ij
Posts: 2
Joined: Tue 27 Aug 2013, 02:45

Stand-alone youtube-dl works without Python installed

#1 Post by nqb648ij »

This project is retired.

This is the well-known Python program, youtube-dl, converted
into a self-contained, stand-alone executable which does not
need Python installed on the system. PyInstaller makes this
possible by combining youtube-dl with the necessary parts of Python
to form the stand-alone executable. It runs the same as a normal
youtube-dl and has been tested on TahrPup 6.0 and Debian 7.8 (Wheezy).
The executable's size is 5.8 MB and is not compressed because bzip2 saves only 30 KB.

[Update January 18, 2016] Downloads are no longer available because the last version of
this project now fails to work at vimeo.com.

My GPG public key:

gpg2 --keyserver pgp.mit.edu --recv-keys DD8A3490

-- or --

Download my GPG public key ASCII file:

https://friskyphotons.us/nqb648ij_public_key.txt
Last edited by nqb648ij on Tue 19 Jan 2016, 00:34, edited 52 times in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

What does it do? Under what conditions would I want to use it? Come on, you have to sell it. :lol:

rokytnji
Posts: 2262
Joined: Tue 20 Jan 2009, 15:54

#3 Post by rokytnji »

Code: Select all

sh-4.1# youtube-dl https://www.youtube.com/watch?v=NzfOgxsWiEQ
sh: /root/my-applications/bin/youtube-dl: Permission denied
Same if I put in /usr/bin in

Code: Select all

sh-4.1# cat /etc/DISTRO_SPECS
#One or more words that identify this distribution:
DISTRO_NAME='Slacko Puppy'
#version number of this distribution:
DISTRO_VERSION=5.6
#The distro whose binary packages were used to build this distribution:
DISTRO_BINARY_COMPAT='slackware'
#Prefix for some filenames: exs: slackosave.2fs, slacko-5.6.sfs
DISTRO_FILE_PREFIX='slacko'
#The version of the distro whose binary packages were used to build this distro:
DISTRO_COMPAT_VERSION='14.0'
#the kernel pet package used:
DISTRO_KERNEL_PET='linux_kernel-3.4.52-slacko_4g_f2fs.pet'
DISTRO_TARGETARCH='x86'
DISTRO_XORG_AUTO='no'
DISTRO_DB_SUBNAME='slacko14'
#32-byte alpha-numeric ID-string appended to vmlinuz, puppy_slacko_5.6.sfs, zdrv_slacko_5.6.sfs and devx.sfs:
DISTRO_IDSTRING='s130812150933ZZZZ5.6XXXXXXXXXXXX'
#Puppy default filenames...
#Note, the 'SFS' files below are what the 'init' script in initrd.gz searches for,
#for the partition, path and actual files loaded, see PUPSFS and ZDRV in /etc/rc.d/PUPSTATE
DISTRO_PUPPYSFS='puppy_slacko_5.6.sfs'
DISTRO_ZDRVSFS='zdrv_slacko_5.6.sfs'
DISTRO_PUPPYDATE='Aug 2013'
#multiarch distros, such as Ubuntu, will have this. ex: /usr/lib/i386-linux-gnu, so DISTRO_ARCHDIR=i386-linux-gnu
DISTRO_ARCHDIR=''
Making it executable and searchable in permissions is a no go also.

Code: Select all

# md5sum youtube-dl 
1e9284f2e2f231b525e52925d24e4adf  youtube-dl
# 
md5sum checks OK
1e9284f2e2f231b525e52925d24e4adf
I renamed it to stream line the command and took the date off. Does that matter?

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

standalone youtube-dl works well in 4.1.2-based pulp03 puppy

#4 Post by sindi »

Download the file (with a javascript browser, not lynx) to /usr/bin or any place else on the path, chmod +x to make it executable.

You can rename it or symlink it to a shorter name youtube-dl
ln -s youtube-dl-* youtube-dl

Use any browser to search for a youtube video. I used lynx.

Cd to some directory with space to hold the downloaded video - I made a download directory outside of the file system -- try /mnt/home/download.

youtube-dl http://youtube.com/watch?v...........

Wait for it to download a 480x360p MP4 (or whatever the default is if Youtube offers higher resolution - I did not read any instructions for changing the default).

I tried to pipe it to mplayer with |mplayer but that did not work.

So , from an rxvt or a terminal (Ctrl-Alt-F2) I typed
mplayer filename.mp4
and it played the video. Alt-F10 makes it full-screen or use mplayer -f
mplayer --help gives you a list of keyboard commands to change volume and move around in the video and adjust sound if out of sync.

I booted with vga=791 so as to get framebuffer console at 1024 (modprobe fbcon)
so from a real terminal mplayer plays in about 1/4 of the screen.
Nodrmally I think the video would fill the screen.

The mplayer is from puppy 4 repository.

mplayer first looks for x11 then finds some mode that works. mplayer -vo fbdev or fbdev2 work too.

You can kill X (ctl-alt-backspace, I think) to save cpu power and memory before
starting mplayer.

I have not yet tried playing the video while it is still downloading (as filename.mp4.temp?)
That worked when using a flash download plugin with a graphical browser.

The download speed is about 310Kbps (I have a '3MBps' bandwidth) which means the file downloads in about 1/4-1/5 the time it takes to play. A 45 min video would take about 10 min to download.

Mplayer uses far less cpu than flash/browser. If sound goes out of sync try + or -, or
-framedrop or -hardframedrop. It also uses negligible memory (compared with Firefox/Flash which can easily use 150% of RAM and nearly 100% of cpu).

I will check this mplayer on a P55C (233MHz) computer with the above adjustments.
Sound was way out of sync even at 400MHz but I had X11 running, and a browser.

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Default download location in /root

#5 Post by sindi »

I found a large .mp4.part file in /root which filled my filesystem so stopped the download.
Mplayer played the .mp4.part file. I don't see an obvious way to download to another location outside the filesystem. Now the downloader won't download because the system thinks the filesystem is still full despite deleting the large file.

User avatar
nqb648ij
Posts: 2
Joined: Tue 27 Aug 2013, 02:45

Notes on youtube-dl use

#6 Post by nqb648ij »

youtube-dl has many options for controlling its behavior, reading the
documentation is very helpful.

Main page for youtube-dl documentation:
http://rg3.github.io/youtube-dl/documentation.html

Local help:

Code: Select all

youtube-dl  --help | less
You can safely rename the youtube-dl file.

At a command-line, the following will give correct permissions to youtube-dl:

Code: Select all

chmod  --verbose  755  /path/to/youtube-dl
Quick-and-dirty command for downloading a Youtube video as a MP4 to a specific location:

Code: Select all

youtube-dl  -f 18  -o -  'https://www.youtube.com/watch?v=YADAYADA'  >  /path/to/blahblah.mp4

rokytnji
Posts: 2262
Joined: Tue 20 Jan 2009, 15:54

#7 Post by rokytnji »

Sorted it out with your kind guys suggestions. Thanks for listening.
I can say this works in SlackO 5.6 now.

It sits in /usr/bin and the

Code: Select all

chmod +x youtube-dl
with terminal in /usr/bin opened did the trick.
Last edited by rokytnji on Sun 19 Jan 2014, 20:28, edited 1 time in total.

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

Youtube-dl in Pulp03 4.1.2-based with glibc 2.11.2-10

#8 Post by sindi »

I tried the downloader with 4.1.2-based pulp03 and it wanted glibc 2.7 and 4.1.2 and 4.3.1 and standard 4.3.2 use glibc 2.6. (There is now an 'updated' 4.3.2 with glibc 2.10). Using a thinkpad 560x P55C (i586, early pentium) with challenging sound which was working last time but not this time....

From the puppy linux discussion on glibc upgrade http://www.murga-linux.com/puppy/viewtopic.php?t=66373 I downloaded (from a link a ways down the page - first link is broken) libc6_2.11.2-10_i386.deb and installed it from the download locatoin with dpkg-deb -x libc*.deb / (I usually use 2.11.3 from the deb archives but could not find it for i386 and this computer is i586).

I have never had any problems from using either deb package in 4.1.2 or 4.3.1 puppies.

I was able to download a youtube video --cache-dir /mnt/home/download
I don't yet know how to download 240p mp4 - it came out as 360p and plays too slowly at 233MHz with mplayer in an rxvt. Exiting X first might help (mplayer -vo fbdev video.mp4.part).

rokytnji
Posts: 2262
Joined: Tue 20 Jan 2009, 15:54

#9 Post by rokytnji »

Code: Select all

# youtube-dl https://www.youtube.com/watch?v=yJXIvu4HqiY
[youtube] Setting language
[youtube] yJXIvu4HqiY: Downloading webpage
[youtube] yJXIvu4HqiY: Downloading video info webpage
[youtube] yJXIvu4HqiY: Extracting video information
[youtube] yJXIvu4HqiY: Encrypted signatures detected.
[youtube] yJXIvu4HqiY: Downloading js player vflbxes4n
[youtube] yJXIvu4HqiY: Downloading js player vflbxes4n
[download] Destination: BLACK TUSK - 'Truth Untold' (Official Music Video)-yJXIvu4HqiY.mp4
[download]   8.4% of 83.81MiB at 167.02KiB/s ETA 07:50
Working in MacPup 529 M/C Shop Desktop.

Box:

Code: Select all

sh-3.00# inxi -Fxz
System:    Host: puppypc293 Kernel: 3.2.18 i686 (32 bit, gcc: 4.6.3) 
           Desktop: Enlightenment 0.16.999.71440 Distro: macpup Linux Linux 3.2.18 [ arch]
Machine:   System: IBM product: 679421U
           Mobo: IBM model: IBM Bios: IBM version: 20KT46AUS date: 06/04/2004
CPU:       Single core Intel Pentium 4 CPU (-UP-) cache: 256 KB flags: (pae sse sse2) bmips: 3589.51 clocked at 1794.007 MHz 
Graphics:  Card: NVIDIA NV6 [Vanta/Vanta LT] bus-ID: 01:00.0 
           X.org: 1.11.3 driver: vesa tty size: 80x24 Advanced Data: N/A for root 
Audio:     Card: Intel 82801BA/BAM AC'97 Audio Controller driver: snd_intel8x0 ports: 1c00 1840 bus-ID: 00:1f.5 
           Sound: Advanced Linux Sound Architecture ver: 1.0.24
Network:   Card-1: Intel 82801BA/BAM/CA/CAM Ethernet Controller driver: e100 ver: 3.5.24-k2-NAPI port: 2000 bus-ID: 02:08.0
           IF: eth0 state: down mac: <filter>
           Card-2: Realtek RTL8187B Wireless 802.11g 54Mbps Network Adapter usb-ID: 001-002
           IF: N/A state: N/A mac: N/A
Drives:    HDD Total Size: (48.5GB,7.5% used) () 1: id: /dev/sda model: WDC_AC28400R size: 8.5GB temp: 0C 
           2: id: /dev/sdb model: IC35L040AVVA07 size: 40.0GB temp: 30C 
Partition: ID: swap-1 size: 1.17GB used: 0.00GB (0%) fs: swap 
RAID:      No RAID devices detected - /proc/mdstat and md_mod kernel raid module present
Sensors:   System Temperatures: cpu: 26.0C mobo: N/A 
           Fan Speeds (in rpm): cpu: N/A 
Info:      Processes: 70 Uptime: 4 days Memory: 312.0/1136.1MB Runlevel: 5 Gcc sys: N/A Client: Shell (sh) inxi: 1.9.18 

sindi
Posts: 1087
Joined: Sun 16 Aug 2009, 13:30
Location: Ann Arbor MI USA

240p flv or 144p 3gp play perfectly at 233MHz/160MB RAM

#10 Post by sindi »

Thinkpad 560x 233Mhz 160MB RAM (EDO - my other 560X has 96MB). No
framebuffer support. i589 (P55C). Xorg at 800x600. Crystal 4236 sound
obtained by booting pnpbios=off acpi=off and choosing 4236 - automatic
selection does not work. (See separate discussion of thinkpad sound).

Upgraded to glibc 2.10 (see separate discussion) for i386.

gxine comes with puppy 4.3.1 but uses far too much cpu or memory.

Mplayer for puppy 4 does not support this cpu. I have a uclibc version
compiled for basiclinux (all programs there will work with kernel 2.4
and glibc 2.3.6 or earlier) at
http://keesan.freeshell.org/bl/mplayer- ... ry2-uclibc

The mplayer in pulp linux 1.0rc8 includes a gmplayer that works only
in X but has a graphical vol control and shows time elapsed. I think it
works with this hardware but sound stopped working in pulp (4.1.2
based). (I think it also came with pulp but not sure).

Opera 10 uses less memory than firefox but still too much to even load
the youtube.com page - over 100%, things freeze up. I was going to try
playing a 240p video just to see how much cpu it used.

You can list available resolutions of any video with
youtube-dl -F http://.......

The help for youtube-dl did not bother to explain what 22/17/18 referred
to (which resolutions) so I tested one site.

My test site offered several mp4 resolutions in DASH video, which this
mplayer did not play.

It also offered -f 17 3gp (144p), -f 5 flv (240p) and -f 18 mp4 (360p).
I downloaded them all - at full bandwidth (260Kps or more).
The default is the 360p mp4 file (labelled 'best'). I don't know if
360p is always the default or if it would download 720p or 1080p if
available.

A firefox youtube downloader plugin downloads flvs at 58Kps.

I was able to play all three formats.
3gp - 1MB file - 32% of cpu mplayer / 3% for X
flv - 4MB file - 41% / 8%
mp4 - 6.2MB file - 91% / 3%

I freed up some cpu and ram by killing ROX-filer, blinky, freememapplet,
cupsd, with no improvement.

Memory usage was about 15% for X plus mplayer for all three formats
(resolutions). 15% of 160MB is about 24MB, and puppy uses about 75MB
without the above programs/processes running, so even the 96MB-RAM 560X
has a chance of playing a 240p flv. 128MB would be much better, and
256MB enough to run opera without flash (open one tab at a time).

When playing the MP4 I was told 'your computer is too SLOW' and the
video played much too slowly and with sound way out of sync.

There is no framebuffer video on this or a 400MHz thinkpad 600e.

Framebuffer mplayer -vo fbdev in a real terminal after exiting X did not
help even at 600MHz. Sound was very out of sync. Supposedly + and -
could help with that.

360p plays fine at 900MHz even in flash, but for speeds between 600 and
900 framebuffer might make it possible to play 360p with mplayer.

The other two formats (144p and 240p) were watchable with good sound and
no jerkiness. The 144p might work at 133MHz with enough RAM, but the
mplayer I used does not support P54C cpus and ones I compiled for P54C
do not support video (because they were too slow to play DVDs). It is
an awfully tiny picture. P55C (MMX) was released in January 1997, at
speeds 166-233MHz and FSB 60 or 66.6, socket 7. P54C and CS 133-200MHz,
so not every 200MHz will work with my uclibc mplayer.

Anyone want to test on a P55C at 166MHz (and at least 96MB RAM)?
640x480 video is overkill.

jlst

#11 Post by jlst »

WOW this is exactly what I was looking for.... THANKK YOU!! ... I will always come back to check if there is any updates

Post Reply