Great thanks alot!<div>I&#39;ll take a look at this and see.</div><div>I guess this could be run additionally in the same or different user job no?<br><br><div class="gmail_quote">On 31 January 2012 01:27, Raymond Wagner <span dir="ltr">&lt;<a href="mailto:raymond@wagnerrp.com">raymond@wagnerrp.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 1/30/2012 20:03, Michael T. Dean wrote:<br>
&gt; fixed top-posting<br>
&gt;<br>
&gt; On 01/30/2012 07:09 PM, David Crawford wrote:<br>
&gt;&gt; On 30 January 2012 23:33, Jeremy Jones wrote:<br>
&gt;&gt;&gt; On Mon, Jan 30, 2012 at 1:34 PM, David Crawford wrote:<br>
&gt;&gt;&gt;&gt; I managed to get the script to work as a userjob in the end (whay hey!)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; only thing is the file names system of the recordings. I use an app to<br>
&gt;&gt;&gt;&gt; search through the subtitles and its designed to work with files with a<br>
&gt;&gt;&gt;&gt; particular format (basicially the one used in DVBVIewer).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Is there a way that I can maybe add a script that can change the<br>
&gt;&gt;&gt;&gt; filenames of the ripped subtitle files to read like:<br>
&gt;&gt;&gt;&gt; %date%-%time%-%channel%-%programme% ?<br>
&gt;&gt;&gt; Take a look at <a href="http://mythlink.pl" target="_blank">mythlink.pl</a>.  It is designed to create symbolic links<br>
&gt;&gt;&gt; of your recordings with *pretty* names like you described above, but<br>
&gt;&gt;&gt; with some string substitutions, I bet you can piece something together<br>
&gt;&gt;&gt; to work for your user created subtitle files. (If I understand what<br>
&gt;&gt;&gt; you are doing in your userjob correctly)<br>
&gt;&gt; Yeah, I actually took a look at that. The thing is I want to actually<br>
&gt;&gt; re-name the subtitle files only in this &quot;pretty&quot; format otherwise the<br>
&gt;&gt; application I have wont be able to read them properly. Just not sure how to<br>
&gt;&gt; piece together what i need..<br>
&gt; I was thinking your script is in Python, in which case you probably want<br>
&gt; to use the Python bindings&#39; support for creating pretty names.  It works<br>
&gt; with the same formatting specifiers as the Perl bindings&#39;/<a href="http://mythlink.pl" target="_blank">mythlink.pl</a> ones.<br>
<br>
</div></div>Specifically<br>
<a href="http://www.mythtv.org/wiki/0.24_Python_bindings/Data_Handlers#formatPath" target="_blank">http://www.mythtv.org/wiki/0.24_Python_bindings/Data_Handlers#formatPath</a><br>
<br>
You could do something like...<br>
<br>
import os<br>
from MythTV import MythBE, findfile<br>
be = MythBE()<br>
prog = be.getRecording(&lt;chanid&gt;, &lt;starttime&gt;)<br>
oldbase = prog.basename.rsplit(&#39;.&#39;,1)[0]<br>
newbase = prog.formatPath(&#39;...&#39;).rsplit(&#39;.&#39;,1)[0]<br>
sg = findfile(prog.basename, prog.storagegroup)<br>
if sg is None:<br>
     raise Exception(&#39;file not found&#39;)<br>
for f in os.listdir(sg.dirname):<br>
     if not (f.startswith(oldbase) and f.endswith(&#39;srt&#39;)):<br>
         continue<br>
     os.rename(os.path.join(sg.dirname, f), os.path.join(sg.dirname,<br>
newbase+&#39;.&#39;+f.split(&#39;.&#39;)[1]))<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
</div></div></blockquote></div><br></div>