My Name is Hank · @mynameishank
14 followers · 354 posts · Server mastodon.lol

What are my love languages, you ask?

Well, one has to be the making of ad-hoc batch conversion shell scripts using `ffmpeg`.

#lovelanguage #ffmpeg #ShellScripting

Last updated 2 years ago

Marximus Maximus · @MarximusMaximus
6 followers · 46 posts · Server eldritch.cafe

! More batteries-forking-included & friends -- CI, unit tests, and more. Bring your questions for the AMA, come to just or .

twitch.marximus.com

#goinglive #programming #hangout #cowork #python #ShellScripting

Last updated 2 years ago

Marximus Maximus · @MarximusMaximus
6 followers · 41 posts · Server eldritch.cafe

Still working on batteries-forking-included & friends CI and unit test stuff, getting everything back in the green. Come on by with your AMA questions, just to hang out, or to cowork.

twitch.marximus.com

#goinglive #python #programming #coworking #ama #ShellScripting

Last updated 2 years ago

R0zambo ☑️ · @r0zambo
100 followers · 227 posts · Server ioc.exchange

Learning Can me fellow tooters follow me and I will follow back

#powershell #ShellScripting #boostpls

Last updated 2 years ago

Karl Voit :emacs: :orgmode: · @publicvoit
1405 followers · 11603 posts · Server graz.social
Doc Edward Morbius ⭕​ · @dredmorbius
2082 followers · 14677 posts · Server toot.cat

Say, for the sake of argument, you'd like to get a complete listing of a YouTube channel's videos, along with titles and video URLs, plus, for shins'n'grits, the mpv command to play said video at a specified resolution.

That is, you're not downloading the video, but you're getting what you need to create a playlist.

Output might look like, say:

   1  Title: How to write a Philosophy Paper (Basics)
ID: 5xCx3UkeCh8
URL: yewtu.be/watch?v=5xCx3UkeCh8
command: mpv --ytdl-raw-options="format=bestvideo[height<=480]+bestaudio" yewtu.be/watch?v=5xCx3UkeCh8

Solution: youtube-dl and some gawk:

#!/bin/bash

youtube-dl --get-title --get-id 'youtube.com/channel/UC1VzCyqpm' 2>/dev/null |
gawk ' {

# Single and double quotes
sqo = "\x27"
dqo = "\x22"
options = "--ytdl-raw-options=" dqo "format=bestvideo[height<=480]+bestaudio" dqo

title = $0
getline;
id = $1
url = "yewtu.be/watch?v=&quot; id
mpv_command = "mpv " options " " url


printf( "%4i Title: %s\n", ++i, title )
printf( " ID: %s\n", id);
printf( " URL: %s\n", url )
printf( " command: %s\n\n", mpv_command )
# system (mpv_command)
}'

(This is specific to the Carneades.org channel and a 480p format, season to taste.)

Playlist here was > 3k videos. Runtime was about 40 minutes --- I presume YouTube rate-limit such requests.

Grep and other shell futzing could extract URLs, or simply generate a set of play requests. I'd experimented with running mpv directly from gawk (the "system()" call, commented out), but decided against that in this case.

I could probably get other metadata, such as upload dates and the like, will experiment. There are several youtube-dl features for grabbing metadata and annotations.

#ShellScripting #youtubedl #linux #macos #mpv #youtube

Last updated 3 years ago

FOSSlife · @FOSSlife
865 followers · 1026 posts · Server mastodon.fosslife.org

Training Sale: The Mastering Linux Development Bundle from TechRepublic Academy is only $19.99 for a limited time buff.ly/3w1ZTZy

#TechRepublic #KaliLinux #softwaredevelopment #CommandLine #ShellScripting #Linux #training

Last updated 3 years ago

Doc Edward Morbius ⭕​ · @dredmorbius
2070 followers · 14630 posts · Server toot.cat

@mntmn Bash history is written to file when bash terminates normally (e.g., you won't save history on crash), and the most-recently-saved history will overwrite portions of the file.

You can set history size (for both the shell session and the saved file), as well as the history file identity: $HISTSIZE $HISTFILESIZE and $HISTFILE (man bash for more info).

Recent bash versions also save timing information. I'm old-school enough that this is new-fangled and I've not used it.

You can bump HISTSIZE and HISTFILESIZE up. Default is 500, a value of 0 prevents history from being kept. I'll typically bump this up a lot (a few thousand). Set HISTIGNORE for patterns to not save, and HISTCONTROL for further tuning.

$HISTTIMEFORMAT apparently triggers the timing to be saved.

#bash #ShellScripting #shell

Last updated 3 years ago

FOSSlife · @FOSSlife
864 followers · 1026 posts · Server mastodon.fosslife.org
FiXato · @FiXato
393 followers · 9413 posts · Server toot.cat

Part of me wonders why I am coding in plain rather than in when it's quite likely I'm going to be the only one who'll actually use it. 🤔

I mean, I like / , but I also think I would save myself a bit of time implementing and looking up of things that either come for free with Python, or in a library.

#CliPlayerQueue #bash #python #bashscripting #ShellScripting #coding

Last updated 4 years ago