get_iplayer forums

An easy way to get rid of word 'tracks' in the tracklist file name - Printable Version

+- get_iplayer forums (https://forums.squarepenguin.co.uk)
+-- Forum: Windows Forums (https://forums.squarepenguin.co.uk/forum-8.html)
+--- Forum: Windows General Help & Support (https://forums.squarepenguin.co.uk/forum-5.html)
+---- Thread: An easy way to get rid of word 'tracks' in the tracklist file name (https://forums.squarepenguin.co.uk/thread-2002.html)



An easy way to get rid of word 'tracks' in the tracklist file name - heyvalera - 13-03-2019

Is there a simple way to indicate that the ...tracks.txt file should be just .....txt? I looked at the options, but did not find anything there. Of course, I could tinker with the code, but I'd rather not do it with every new version released.
thanks in advance!


RE: An easy way to get rid of word 'tracks' in the tracklist file name - User 04 - 15-03-2019

Running get_iplayer 3.20.0-MSWin32 from a Microsoft Windows 7 Home Premium (Version 6.1.7601) CMD shell.

Hi heyvalera,

The .tracks.txt and .credits.txt file extensions require the additional word to avoid file naming collisions. Probably the best way to change the downloaded .tracks.txt to just .txt would be to do so after successfully downloading the programme utilizing the --command option. For example, add the following to a download, or add it to a preset, or add it to your preferences (for Windows, but similar for other operating systems):
Code:
--command "ren \""<dir>\<fileprefix>.tracks.txt\"" \""<dir>\<fileprefix>.txt\"""



RE: An easy way to get rid of word 'tracks' in the tracklist file - dinky - 17-03-2019

That won't work - wrong syntax for rename. Use this instead:
Code:
--command "rename \""<tracklist>"\" \""<fileprefix>.txt"\""
If you want to overwrite existing files, use move:
Code:
--command "move /y \""<tracklist>"\" \""<dir>\<fileprefix>.txt"\""



RE: An easy way to get rid of word 'tracks' in the tracklist file - heyvalera - 17-03-2019

thank you VERY much for your suggestion! It all makes sense - to automate renames afterwards. Thanks again!


RE: An easy way to get rid of word 'tracks' in the tracklist file - User 04 - 18-03-2019

(17-03-2019, 05:27 PM)dinky Wrote: That won't work - wrong syntax for rename.

Yeah, how embarrassing, apologies to all.

It just occurred to me yesterday that the example I gave wouldn't work. And even with the correct escapes of the double quotes, the <dir>\ in the second argument to ren is superfluous. I'd also forgotten about the <tracklist> substitution parameter.

(The example I gave is wrong, but it would happen to work when adding it to preferences or a preset, go figure!)

So, coming back here to correct my error I find dinky's got it all sorted out and corrected for me. Thanks.

Before any similar postings in the future, I'll run a couple of quick tests—I usually do, but thought this one was simple and didn't require it, sorry.