[mythtv-users] User Job to rip subtitles from each program
davidcrawford83 at gmail.com
Tue Jan 31 01:30:33 UTC 2012
Great thanks alot!
I'll take a look at this and see.
I guess this could be run additionally in the same or different user job no?
On 31 January 2012 01:27, Raymond Wagner <raymond at wagnerrp.com> wrote:
> On 1/30/2012 20:03, Michael T. Dean wrote:
> > fixed top-posting
> > On 01/30/2012 07:09 PM, David Crawford wrote:
> >> On 30 January 2012 23:33, Jeremy Jones wrote:
> >>> On Mon, Jan 30, 2012 at 1:34 PM, David Crawford wrote:
> >>>> I managed to get the script to work as a userjob in the end (whay
> >>>> only thing is the file names system of the recordings. I use an app to
> >>>> search through the subtitles and its designed to work with files with
> >>>> particular format (basicially the one used in DVBVIewer).
> >>>> Is there a way that I can maybe add a script that can change the
> >>>> filenames of the ripped subtitle files to read like:
> >>>> %date%-%time%-%channel%-%programme% ?
> >>> Take a look at mythlink.pl. It is designed to create symbolic links
> >>> of your recordings with *pretty* names like you described above, but
> >>> with some string substitutions, I bet you can piece something together
> >>> to work for your user created subtitle files. (If I understand what
> >>> you are doing in your userjob correctly)
> >> Yeah, I actually took a look at that. The thing is I want to actually
> >> re-name the subtitle files only in this "pretty" format otherwise the
> >> application I have wont be able to read them properly. Just not sure
> how to
> >> piece together what i need..
> > I was thinking your script is in Python, in which case you probably want
> > to use the Python bindings' support for creating pretty names. It works
> > with the same formatting specifiers as the Perl bindings'/mythlink.plones.
> You could do something like...
> import os
> from MythTV import MythBE, findfile
> be = MythBE()
> prog = be.getRecording(<chanid>, <starttime>)
> oldbase = prog.basename.rsplit('.',1)
> newbase = prog.formatPath('...').rsplit('.',1)
> sg = findfile(prog.basename, prog.storagegroup)
> if sg is None:
> raise Exception('file not found')
> for f in os.listdir(sg.dirname):
> if not (f.startswith(oldbase) and f.endswith('srt')):
> os.rename(os.path.join(sg.dirname, f), os.path.join(sg.dirname,
> mythtv-users mailing list
> mythtv-users at mythtv.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-users