Share your projects


PokeParadox

Founder of Pirate Games - Penjin Coder
Staff member
Joined
Dec 8, 2005
Messages
6,560
Age
37
Location
UK
Website
pokeparadox.itch.io
WEBSITE
https://github.com/pokeparadox
YOUTUBE
pokeparadox
I've been trying to be active again in game dev - I don't think I can get back on the "game engine" bike, but I'm trying to ease back into making something in my spare time...
I took BZar's example game for PenjinTwo and adapted it into Godot Engine and built upon it a little.

 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
I've updated my youtube-dl frontend. It now has subtitle download support, the language subtags go in the options.txt file, e.g. en for English. You can also chain subtags by separating them with a comma, e.g. en,fr,de will download English, French, and German subtitles.
It also has playlist support, which I didn't realise until I decided to see what would happen if I gave it a playlist URL instead of a single video URL. What happens is it downloads all the videos in the playlist + subtitles (if required) to the download location that you specified in the options.txt file.
Different download link this time I'm afraid, sdfeu appears to be down atm so my website is currently inaccessible.


Edit: sdfeu is back up, so my website is now accessible again.
 
Last edited:

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
I've updated my youtube-dl frontend (yet again). Now you can download multiple individual videos at a time if you wish. No more going through the rigmarole of downloading a single video then choosing, yes you'd like to download another video. How you use the new feature is by entering multiple video URLs separated by a comma, e.g.

Code:
https://www.youtube.com/watch?v=07d2dXHYb94,https://www.youtube.com/watch?v=668nUCeBHyY

Download Link
 
  • Like
Reactions: rSl

FBnil

Pyraturi te salutant
Joined
Dec 14, 2012
Messages
3,814
Location
Yurp
I've updated my youtube-dl frontend (yet again). Now you can download multiple individual videos at a time if you wish. No more going through the rigmarole of downloading a single video then choosing, yes you'd like to download another video. How you use the new feature is by entering multiple video URLs separated by a comma, e.g.
Ok, I'll bite.

I've downloaded your version and read all readme's.

So the first thing I have is:

$ python vid_dload_ui.py
Traceback (most recent call last):
File "vid_dload_ui.py", line 4, in <module>
import youtube_dl
ImportError: No module named youtube_dl

Uhm... ok. So if I do not know programming, so I re-read your documentation:

"Make sure you have both Python and youtube-dl installed before trying to run the program."

So I assume these are not there by default. There is no mention about how to get youtube-dl


Code:
$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libexpat1-dev libjs-sphinxdoc libpython-all-dev libpython-dev libpython2-dev libpython2.7-dev python-all python-all-dev
  python-configparser python-crypto python-dev python-entrypoints python-keyring python-keyrings.alt python-pip-whl
  python-secretstorage python-setuptools python-wheel python2-dev python2.7-dev
Suggested packages:
  python-crypto-doc gir1.2-gnomekeyring-1.0 python-gdata python-keyczar python-secretstorage-doc python-setuptools-doc
The following NEW packages will be installed:
  libexpat1-dev libjs-sphinxdoc libpython-all-dev libpython-dev libpython2-dev libpython2.7-dev python-all python-all-dev
  python-configparser python-crypto python-dev python-entrypoints python-keyring python-keyrings.alt python-pip python-pip-whl
  python-secretstorage python-setuptools python-wheel python2-dev python2.7-dev
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 34,8 MB of archives.
After this operation, 63,4 MB of additional disk space will be used.
Do you want to continue? [J/n]
Ok, 64MB, lots more than I expected. I'll just install that module, even if not documented how to do that:

Code:
$ pip install youtube_dl

Ok, so now U run it:

Code:
$ python vid_dload_ui.py
Enter a video/playlist URL then press enter, multiple URLs can be entered separated by a comma: https://www.youtube.com/watch?v=07d2dXHYb94,https://www.youtube.com/watch?v=668nUCeBHyY
Traceback (most recent call last):
  File "vid_dload_ui.py", line 14, in <module>
    vid_link = input("Enter a video/playlist URL then press enter, multiple URLs can be entered separated by a comma: ")
  File "<string>", line 1
    https://www.youtube.com/watch?v=07d2dXHYb94,https://www.youtube.com/watch?v=668nUCeBHyY
         ^
SyntaxError: invalid syntax
Hmm... ok, what about quotes?

Code:
$ python vid_dload_ui.py
Enter a video/playlist URL then press enter, multiple URLs can be entered separated by a comma: "https://www.youtube.com/watch?v=07d2dXHYb94"
Download subtitles? Enter y or n then press enter: y
Traceback (most recent call last):
  File "vid_dload_ui.py", line 18, in <module>
    sub_down = input("Download subtitles? Enter y or n then press enter: ")
  File "<string>", line 1, in <module>
NameError: name 'y' is not defined

Ok, what if you wrote it in that other language called Python3?

Code:
$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  dh-python libpython3-dev libpython3.7-dev python3-crypto python3-dev python3-keyrings.alt python3-wheel python3.7-dev
Suggested packages:
  python-crypto-doc gir1.2-gnomekeyring-1.0
The following NEW packages will be installed:
  dh-python libpython3-dev libpython3.7-dev python3-crypto python3-dev python3-keyrings.alt python3-pip python3-wheel python3.7-dev
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 49,5 MB of archives.
After this operation, 87,0 MB of additional disk space will be used.
Do you want to continue? [J/n]
Oh, great, another 88MB...
Code:
$ pip3 install youtube_dl
So lets try it again:

Code:
$ python3 vid_dload_ui.py
Enter a video/playlist URL then press enter, multiple URLs can be entered separated by a comma: https://www.youtube.com/watch?v=07d2dXHYb94
Download subtitles? Enter y or n then press enter: y
[youtube] 07d2dXHYb94: Downloading webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: -/Pip _ A Short Animated Film by Southeastern Guide Dogs.f137.mp4
[download] 100% of 31.88MiB in 00:09
[download] Destination: -/Pip _ A Short Animated Film by Southeastern Guide Dogs.f251.webm
[download] 100% of 4.10MiB in 00:01
[ffmpeg] Merging formats into "-/Pip _ A Short Animated Film by Southeastern Guide Dogs.mkv"
Deleting original file -/Pip _ A Short Animated Film by Southeastern Guide Dogs.f137.mp4 (pass -k to keep)
Deleting original file -/Pip _ A Short Animated Film by Southeastern Guide Dogs.f251.webm (pass -k to keep)
Download Complete.
Ok, that looks better. now where did it save?
Ah, in "-" so I can not cd into that, so I need to rename that directory (or use caja/dolphin/explorer)

So:

It works pretty good. But the documentation needs to state it's Python3. And you need sections for Windows and Unix users.
You might want to try to make it compatible with Python2 (because if I type "y" with the quotes, it just downloads the file too, but the download directory is '-'$'\r' quite messy).
You need to use a different default download directory (maybe something obvious, like "Downloads" will do). Set good defaults. I should not need to change good defaults.

Do you also need me to look at the code itself?

You forgot to add a header with function of the script, owner, where to get the latest and copyright (or copyleft). Clearly documenting which Python version it was written for (Yeah, I know Python2 is dead, but...).

Options.txt has a horrible format. Stick to a format (yaml, ini, conf) and make comments start with #
I like the ini format a lot, why don't you use that?
And rename it to options.ini or vid_dload_ui.ini

Options I miss:

A way to rename the file. I would like it to be "-/Pip _ A Short Animated Film by Southeastern Guide Dogs=07d2dXHYb94.mkv" so I can re-download it, or give that reference to friends if they like the video I show them.
You also need a logfile (which can be optional). So it shows me when I downloaded something from which URL and such.
 
Last edited:

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
13,918
Location
Somewhere off the coast of the EU
What crazy assed OS are you using that still uses python2 as default? That went end of life ages ago now.

But yeah a directory named - (hypen) seems difficult to work with. I can make and delete it, but the only way I can cd into it is 'cd ./-', which is a bit of a faff. My own downloader downloads things into a folder called dld, fwiw.
 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
But the documentation needs to state it's Python3. And you need sections for Windows and Unix users.
You might want to try to make it compatible with Python2 (because if I type "y" with the quotes, it just downloads the file too, but the download directory is '-'$'\r' quite messy).

No.

You need to use a different default download directory

- in the options file is just there as a placeholder character nothing more.

You forgot to add a header with function of the script, owner, where to get the latest and copyright (or copyleft). Clearly documenting which Python version it was written for (Yeah, I know Python2 is dead, but...).

No.

Options.txt has a horrible format. Stick to a format (yaml, ini, conf) and make comments start with #
I like the ini format a lot, why don't you use that?

I'm fine with my format, why don't I use that?

A way to rename the file. I would like it to be "-/Pip _ A Short Animated Film by Southeastern Guide Dogs=07d2dXHYb94.mkv" so I can re-download it, or give that reference to friends if they like the video I show them.
You also need a logfile (which can be optional). So it shows me when I downloaded something from which URL and such.

Neither of those features are of any use to me so I won't be adding them, feel free to add those features to your own version though. In fact feel free to do whatever you want with the program, it is CC0 licensed after all.
 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
I've just uploaded the final version of my youtube-dl frontend to my website.

Additions:

Code:
--geo-bypass                         Bypass geographic restriction via
                                     faking X-Forwarded-For HTTP header

and a more morally acceptable options file.

In other news I'm going to be taking a break of indeterminate length, because things are starting to feel too much like work and I'm not having fun anymore.
 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
I've just uploaded the final final version of my youtube-dl frontend to my website.

The only difference is I've changed options.txt to options.ini in the readme file (because I'd forgotten to in the previous version).

Also here's a "bonus". It's an unfinished version of my latest Bitsy game. I'm uploading it unfinished because I can't stand the sight of it anymore.
It was originally going to be a game where you had to gather parts for a raft to escape from an island. You gathered the parts from the islands animal inhabitants, and when you got a part from an inhabitant they told you a story. Somehow that morphed into a game about you being a prisoner escaping from a space station, avoiding guards etc. Which isn't what I wanted in the first place, and wanted less as time went on.

I've deleted the game from my hard drive + back up drive and the download link is set to expire in seven days, so get it while you can.


Edit: As always it's CC0 licensed.
 
Last edited:
  • Like
Reactions: rSl

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
Am fairly close to releasing the first version of my unit convertor program. It was originally going to be written in JavaScript, now it's a Python GUI application.

I've also updated the readme files of my other programs to mention that they require Python3 + that the required extra modules can be installed via pip.
 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
Here's the first version of my unit conversion tool. There's only a small number of units available to convert between currently, but I definitely plan on adding more.
It took longer than expected to do due to feature creep (originally error messages were going to be displayed via a highly annoying message box, but that changed to them being displayed in a rather different way due to me getting ideas above my station). Also as it turns out the IDE that I'm using (Thonny) displays your program window smaller than it should be if you run it using the standard run button. If you want it to be displayed full size then you have to use the "Run current script in terminal" menu option. I have no idea why it does this.

Website
 
  • Like
Reactions: rSl

FBnil

Pyraturi te salutant
Joined
Dec 14, 2012
Messages
3,814
Location
Yurp
Here's the first version of my unit conversion tool. There's only a small number of units available to convert between currently, but I definitely plan on adding more.
This one is more complex than your previous one. I like that. Let's see: If a noob reads it, it must follow some logical crescendo. So you should put unit_dict early in the code, before you calculate() with it.
If you want to go forward, maybe add the US measurements.
Why not procedurally create your unit_dict ? so define an array that has mm -> cm -> dm -> m -> dam -> hm -> km and loop both sides with factors of 10 (recursively or with 2 loops?). But then, the strings "X to Y" become so many, that calculating the factor later is more compact (with 2 measurements). If so, then each factor will need a uniform conversion number to, say, meters:

cm=0.01
dm=0.1
m=1
hm=100
inch=0.0254

So from inch(0.0254) to dm(0.1) we have a factor of: 0.0254/0.1=0.254
multiply that factor with the amount of inch and you get the amount of dm. So we go from inch => m => dm (where the meter is the standard unit)
Drawback of this method is the rounding error that slips in.
 

Null

Velocipede
Joined
Jun 16, 2007
Messages
11,151
Website
www.pixelfed.social
WEBSITE
https://elderberry.sdf-eu.org
So you should put unit_dict early in the code, before you calculate() with it.

Job done on that front, because the functions that use it don't get called until you click on a button, by which time the dictionary has been loaded into memory.

If you want to go forward, maybe add the US measurements.

Yep I plan on adding imperial measurements too. I've only added metric ones so far because it made testing things easier.

Why not procedurally create your unit_dict ?

Because I didn't know how to at the time. It's like you think I'm an expert or something. ;)
 

FBnil

Pyraturi te salutant
Joined
Dec 14, 2012
Messages
3,814
Location
Yurp
It's like you think I'm an expert or something.
I'm challenging you. I know you are not an expert, you said it yourself. But I know you CAN do it.
(hey, even I do google-fu (well actually duck-duck-fu) to find pieces of code I can copy and ram them with a hammer until they do what I want.
+1 on that imperial thing. Combined with that GUI, I'd be something I would use on the Pyra. So you got a user, if you decide to make a DBP package.

ps: I've downloaded 30 videos so far with your vid_dload_ui.py (I've added a hasbang and I've had to "pip3 install -U youtube_dl" because the lib broke a few days ago when YT changed their backend).
I used Video Download Helper, but that thing uses a lot of RAM when it merges the streams (and doesnt give it back, so it leaks), so this way I offload my FF.
 

elw3

ƐʍlƎ
Joined
Aug 10, 2010
Messages
1,517
I never got around to understand how this conversations works.
Does every Murican know his feet size that exact?
What happens if two masons with different shoe size work on the same house? How can the walls be straight?
 
Top