Topic: Lilya-Helper - A simple bat tool for easier YT downloading

Posted under e621 Tools and Applications

Hello hi I'm bad at programming but I have been onto this project of mine that is Lilya-Helper

So I made the helper after a friend of mine a year ago was having trouble with yt-dlp due to not being much tech savvy so i help them out and have been implementing stuff for me and for them for better usage

https://github.com/FlowerSylveon/Lilya-Helper.bat

I wanted to share it here because I also implemented an extra option to download from youtube with the webm extension so it's easier for uploading, and because i need more people testing it to improve further

Plans

  • Implement further with integration for ffmpeg, so it would be possible to download from somewhere else and along already transcode to webm/gif, I know it's possible, its just that I haven't been able to properly figure it out
    • Implement a branch for just ffmpeg usage for converting/transcoding media

Note: I learned programming from scratch with error and testing, if you have any tips for improving my little tool with extra changes, feel free to tell me about it, either here or in the github

Updated

aurorianarchivist said:
Note: I learned programming from scratch with error and testing, if you have any tips for improving my little tool with extra changes, feel free to tell me about it, either here or in the github

Not using Windows personally so I can't comment on the functionality, but the code looks pretty clean and well formatted. I was just looking at https://stackoverflow.com/questions/33744809/batch-file-multiline-command-with-double-quotes and wondering if you could use caret continuations to reduce some of your copious echos?, eg looking at this early pile of echos, I converted it to one echo:

if exist "spot2yt.py" echo "		      Spot2yt: Spotify Downloader^
.^
			Here some options for you^
 		    Some require ffmpeg [FPG prefix]^
 			      Good enough [1]^
.^
 		      [FPG] Best Quality(MP4) [2]^
 		     [FPG] Best Quality(WEBM) [2w]^
 		  [FPG] Audio Extraction(MP3) [audio]^
.^
 		             [1^|2^|2w^|Audio]^
."

Again, I'm not in a position to test this, so it may not work -- it probably depends on how echo handles newlines -- but hopefully it's a usable technique.

savageorange said:
but the code looks pretty clean and well formatted

it took me a while to make it formatted like that, it was jank and you can see the evolution from the old versions in the folder

savageorange said:
wondering if you could use caret continuations to reduce some of your copious echos?, eg looking at this early pile of echos, I converted it to one echo:

i could also do what i did for the changelog if you look into the code which is just chaining a bunch of echo together
i tried this out and didn't seem to work, doesn't chain the commands as it's "supposed" to be doing

savageorange said:
it probably depends on how echo handles newlines

echo.
is what makes new lines to show up as empty lines

i could maybe try reading more about as it gave me an error tho i don't mind having lots and lots of echo, not quite an issue per say
if i get more time to read about i could try rewrite and test the code to see if it can be more clean looking but otherwise non-issue

Thank you for the recommendation regardless!

aurorianarchivist said:
it took me a while to make it formatted like that, it was jank and you can see the evolution from the old versions in the folder

Standard programmer/code development arc ;)

i could also do what i did for the changelog if you look into the code which is just chaining a bunch of echo together
i tried this out and didn't seem to work, doesn't chain the commands as it's "supposed" to be doing

hm? Do you mean that the if exist test doesn't trigger the 'echo'? I guess there's a parsing error when reading the echo command then. I considered the possibility of a limit on argument length, but that entire big string is still just 300 characters, so probably not that. Could also be a limitation on number of lines that continuations are allowed to combine.

The echo ..& echo..& technique clearly works, although my brain wants to say 'surely we can write this thing that is in practice one big string as .. one big string, somehow?'

echo.
is what makes new lines to show up as empty lines

Ah, I wondered about that. If this method could be made to work I think those lines could just be ^ then.

i could maybe try reading more about as it gave me an error tho i don't mind having lots and lots of echo, not quite an issue per say

It's more of a 'less visual noise -> easier to read and update' thing. A maintenance nicety, if it can be made to work.

savageorange said:
Do you mean that the if exist test doesn't trigger the 'echo'? I guess there's a parsing error when reading the echo command then. I considered the possibility of a limit on argument length, but that entire big string is still just 300 characters, so probably not that. Could also be a limitation on number of lines that continuations are allowed to combine.

every line after the first echo doesn't go, it's not recognized as a continuation and more reading it

the issue is that only few things can break out of the echo
echo would be the same as doing

[b]bold[/b]

instead of
bold

it reads raw text with no formatting unless it gets broken by other things like & or |
maybe the reason it's not working is because echo works differently
it's possible to break the functionality of & and | by using ^ before it, you can see that above the if exist part where is

echo 			     Extra Options:
echo        Menu: Come back here         ^| 	Back: goes back an option
echo        Setting: Unavailable         ^| 	Help: Display Help menu
echo        Changelog: Display Changes   ^| 	Bug: Goes to bug and issues page

savageorange said:
It's more of a 'less visual noise -> easier to read and update' thing. A maintenance nicety, if it can be made to work.

i have been working on it for a year now
it's not that much clutter since it's just the echo parts
tho i have been experimenting on adding empty tabs to make separation of other stuff as you could see at the start of the program