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
#GoingLive! More batteries-forking-included & friends -- CI, unit tests, and more. Bring your questions for the #Programming AMA, come to just #hangout or #cowork. #Python #ShellScripting
#goinglive #programming #hangout #cowork #python #ShellScripting
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. #GoingLive #Python #Programming #Coworking #AMA #ShellScripting
#goinglive #python #programming #coworking #ama #ShellScripting
Learning #powershell Can me fellow #ShellScripting tooters follow me and I will follow back #boostpls
#powershell #ShellScripting #boostpls
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: https://yewtu.be/watch?v=5xCx3UkeCh8
command: mpv --ytdl-raw-options="format=bestvideo[height<=480]+bestaudio" https://yewtu.be/watch?v=5xCx3UkeCh8
Solution: youtube-dl and some gawk:
#!/bin/bash
youtube-dl --get-title --get-id 'https://youtube.com/channel/UC1VzCyqpmCaRh8_BnijbOvg' 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 = "https://yewtu.be/watch?v=" 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
Training Sale: The Mastering Linux Development Bundle from TechRepublic Academy is only $19.99 for a limited time https://buff.ly/3w1ZTZy #training #Linux #ShellScripting #CommandLine #SoftwareDevelopment #KaliLinux #TechRepublic
#TechRepublic #KaliLinux #softwaredevelopment #CommandLine #ShellScripting #Linux #training
@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.
Intro to Shell scripting https://buff.ly/3qlU1Y7 #Shell #scripting #tools #ShellScripting #Bash #sysadmin #Linux #OpenSource #coding #FOSS
#foss #coding #opensource #Linux #sysadmin #Bash #ShellScripting #tools #scripting #shell
Part of me wonders why I am coding #CliPlayerQueue in plain #Bash rather than in #Python when it's quite likely I'm going to be the only one who'll actually use it. 🤔
I mean, I like #BashScripting / #ShellScripting, 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