• The forum software that supports hummy.tv will be upgraded to XenForo 2.3 on Wednesday the 20th of November 2024 starting at 7pm

    There will be some periods where the forum is unavailable, please bear with us. More details can be found in the upgrade thread.

Sweeper won't find .m4a files in video folder

rodp

Member
Hi All,

I've just been using youtube downloader to download a radio 4 program. It downloads as a .m4a audio file. I tried setting up sweeper to detect a file name with either .m4a or the name 13_minutes or the title 13 minutes but no matter what I try it wouldn't find a match. I guess there is a hard filter for video files only in the video folder? The problem is youtube downloader saves files to the video folder by default. I'd rather sweeper be able to search for audio files in the video folder. Or..... is there a problem with my install? Can anyone test this out on theirs?

Thanks

Rodp
 
The problem is youtube downloader saves files to the video folder by default.
To change the default edit the config file.
You can open the config file by clicking on the youtube-dl.conf link on the webif's qtube page.
 
I'd rather sweeper be able to search for audio files in the video folder.
sweeper isn't designed for that.

To change the default edit the config file.
You can open the config file by clicking on the youtube-dl.conf link on the webif's qtube page.
There was a problem with qtube not responding to its config file properly, but I think that was fixed. I must check...

It downloads as a .m4a audio file
You don't have to:
Radio Programmes on BBC iPlayer and BBC Sounds

If, like me, you want to download MP3s of radio programmes for use in the car, you will find that (a) downloads are moving over to MP4 Audio (.m4a), and (b) bbc.co.uk/sounds won't co-operate with youtube-dl.

The BBC Sounds problem can be side-stepped by obtaining the equivalent BBC iPlayer URL. The BBC identify their programmes on the website using an arbitrary code string (eg "p08023tz"), which is often the last part of the URL (after the final "/"). By prefixing the programme code string with "https://www.bbc.co.uk/programmes/", it is often possible to access the same programme via iPlayer, and thus for it to become downloadable.

The MP4 Audio problem can be overcome using format conversion within youtube-dl. The command switch -x --audio-format mp3 tells youtube-dl to convert the file to MP3 after download (but takes an awfully long time with the limited processing power of the HDR-FOX). Thus the full command line to download programme "p08023tz" and convert to MP3 would be:
Code:
# youtube -x --audio-format mp3 https://www.bbc.co.uk/programmes/p08023tz

If using qtube (see below), just put "https://www.bbc.co.uk/programmes/p08023tz" in the "URL" box and "-x --audio-format mp3" in the "Process options" box.
 
Luke has answered the underlying issue, if it was just to put the audio files somewhere other than in the [My] Video folder.

You can't use sweeper to move a .m4a, or indeed .mp3, file, because the package, whose design significantly pre-dates the youtube-dl package, only knows about Humax recordings (ie a bundle of files including a .ts media file), at least for now. The folder in which it runs isn't relevant, though AFAIK it only runs in the system's [My] Video folder and its descendants.

Although you could try using yt-dl's --exec post-processing option to convert your audio download to an MPEG2TS container with an AAC audio stream and a .ts extension, so that sweeper could process it, I don't have confidence that the Humax software would play that format.
 
Thanks for the replies. I use the url link as suggested already so could certainly add on the option to convert to mp3 but then there may still be a problem regarding the default directory. This would all be alot easier if sweeper could look for non video files in the video folder. Is there a way I could set up a cron script to move any audio files that may fall into the video folder and move them once a day or something (to the same sub folder structure)?

Thanks

Rodp
 
To add to this, i have written a simple dos script to run off an old laptop that will use ffprobe and ffmpeg to test for files that are audio and not mp3 (mpeg I layer 3) and if so convert them and replace the file, as I know the humax is no good at doing that. So in theory via samba I guess i don't have to move it using sweeper but it was just that I wanted to give it a go and was surprised to find that it wouldn't work. It would be easier for sweeper to do it as then the process would be trigger related rather than time related.

Thanks

Rodp
 
ffmpeg has no particular difficulty running an audio conversion on the HDR-FOX, I do it all the time. If added to the qtube job (as described above), you only have to go away and let it get on with the download and conversion in the background (it doesn't matter how long it takes if you're not waiting for it). A -o option on the same command line takes care of dumping the file in your desired folder.
 
Many of the programs are hours long so converting on the humax is not going to work as the box would need to stay on for days and days plus I assume that when the box goes into standby it will have to start from the beginning of the file it was working on. So I will use an external device to convert them.

so can anyone guide me in setting up a cron script?
Thanks

Rodp
 
Fair enough; converting radio recordings takes about 4x real time, but my boxes are on all the time.
 
..
so can anyone guide me in setting up a cron script?
...
If a daily operation is enough, you can use anacron. You'll need to use the File Editor in the Diagnostics page of WebIf, or be able to open a command-line telnet or Webshell session.

Simply append a line like 1 19 move-audio /mod/bin/move-audio to /mod/etc/anacrontab, where 19 is a random delay (minutes) and /mod/bin/move-audio is a script that you will have written and made executable (File Editor has a button for this, or chmod a+x /mod/bin/move-audio), like this:
Code:
#!/bin/sh
vdir=/mnt/hd2/My\ Video
adir=/mnt/hd2/My\ Music
exts="mp3 m4a"
for xx in $exts; do 
    for ff in "$vdir"/*.$xx; do 
        [ -z "$ff"] && continue
        # -n: don't overwrite destination file
        mv -n "$ff" "$adir"/
    done
done
 
Back
Top