← Home About Archive Photos Also on Micro.blog
  • Music automation with ffmpeg, ntfy and BookPlayer (iOS)

    BookPlayer is a really nice audio player for iOS, not only for audiobooks. It comes with all features needed for longer (offline) audio sessions, incl. lock screen & control center playback, playback speed, chapters, CarPlay and Apple Watch stand-alone support (Pro).

    To import audio files, BookPlayer has support for AirDrop, the Files app, AudiobookShelf, Jellyfin and there is also a simple iOS url scheme:

    bookplayer://download?url=$(FILE_URL)
    

    I fully automated the process of recording a daily radio show (on a Raspberry Pi), upload it to pCloud, create a public link and then send a push notification to my iPhone via ntfy.sh.

    When I tap on the push notification, it automatically runs a Siri shortcut on my iPhone which extracts the raw pcloud download url and forwards it to the BookPlayer app by using the url scheme mentioned above. As a result, I can listen to this daily radio show on my iPhone with just one simple tap.

    In more detail:

    1. record radio show with ffmpeg (via cron)
    TODAY=$(date +'(%a) %d-%m-%Y')
    TARGET_FILE="/output/radioeins_Der_schoene_Morgen_$TODAY$.mp3"
    ffmpeg -y -i $STREAM_URL -c copy -t 04:58:00 -metadata title="Der schöne Morgen - $TODAY" -metadata artist="radioeins vom rbb" -metadata album="Der schöne Morgen" $TARGET_FILE
    
    1. Upload to pCloud
    fileiId=$(curl -s -F "file=@$TARGET_FILE" "https://eapi.pcloud.com/uploadfile?folderid=47110815&auth=$authToken" | jq -r '.metadata[0].fileid')
    
    1. Get pcloud public link
    pcloudLink=$(curl -s "https://eapi.pcloud.com/getfilepublink?fileid=$fileiId&auth=$authToken" | jq -r '.link')
    
    1. Send push notification to iPhone (with Siri shortcut link)
    curl -s -X POST 
    -H "Title: radioeins vom rbb" 
    -H "Click: shortcuts://run-shortcut?name=pcloud-to-BookPlayer&input=text&text=$pcloudLink" 
    -H "Tags: loud_sound" 
    -d "Die heutige Ausgabe von 'Der schöne Morgen' liegt jetzt in der pCloud. (Tap to play)" 
    https://ntfy.sh/******
    

    Siri Shortcut Download: pcloud-to-BookPlayer

    A phone notification in German from radioeins vom rbb announces the availability of Der schöne Morgen on pCloud, along with flashlight and camera icons at the bottom.A smartphone screen displays a podcast or radio show titled Der schöne Morgen - (Mi) 05-11-2025 from radioeins vom rbb, with options for downloading and interaction.

    → 3:36 PM, Nov 17
  • Force mp4 output with yt-dlp

    yt-dlp is the swiss army knife when it comes to downloading videos (not only!) from YouTube.

    In order to get the best compatible format for the Apple ecosystem, I’m always adding a static -f argument. It makes sure to download the best possible H.264/5 video and m4a audio and avoids using webm or opus codecs.

    Example:

    yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' "https://www.youtube.com/watch?v=******"
    

    In order to check all available formats and codecs, use the -F argument.

    → 1:42 PM, Feb 25
  • RSS
  • JSON Feed
  • Micro.blog