[mythtv-users] User Job to rip subtitles from each program

David Crawford davidcrawford83 at gmail.com
Mon Feb 6 19:51:02 UTC 2012


On 5 February 2012 20:14, David Crawford <davidcrawford83 at gmail.com> wrote:

>
>
> On 5 February 2012 19:45, David Crawford <davidcrawford83 at gmail.com>wrote:
>
>>
>>
>> On 5 February 2012 18:53, Michael T. Dean <mtdean at thirdcontact.com>wrote:
>>
>>> On 02/05/2012 11:33 AM, David Crawford wrote:
>>> > Hi,
>>> >
>>> > Can anyone please give me any hints as to where to find a solution for
>>> > the following error?:
>>> >
>>> > Traceback (most recent call last):
>>> >   File "/home/dave/uksub2srt/rename.py", line 22, in <module>
>>> >     '-o', '/home/dave/Downloads/subtitles/{0}.srt'.format(newbase))
>>> >   File "/usr/lib/pymodules/python2.7/MythTV/system.py", line 57, in
>>> > __call__
>>> >     def __call__(self, *args): return self.command(*args)
>>> >   File "/usr/lib/pymodules/python2.7/MythTV/system.py", line 89, in
>>> > command
>>> >     return self._runcmd('%s %s' % (self.path, arg))
>>> >   File "/usr/lib/pymodules/python2.7/MythTV/system.py", line 98, in
>>> > _runcmd
>>> >     raise MythError(MythError.SYSTEM,self.returncode,cmd,self.stderr)
>>> > MythTV.exceptions.MythError: External system call failed: code 126
>>> >
>>> > I've looked through "system.py" but couldnt find any answers..
>>> >
>>> > Is it this part of the script thats failing?
>>> >
>>> > from MythTV import System
>>> > ccextractor = System(path="/home/dave/uksub2srt/uksub2srt.py")
>>> > ccextractor('-i', os.path.join(sg.dirname, prog.basename),
>>> >             '-o', '/home/subtitles/{0}.srt'.format(newbase))
>>>
>>> A 126 error code would be coming from the code inside the uksub2srt.py
>>> script.  You'll have to open it up and read the code to see what's wrong
>>> when it returns a 126 error code.
>>>
>>> Mike
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>>
>>
>> Hi,
>>
>> I've tried looking in the uksub2srt.py but can't find anything in
>> reference to 126 error code.
>>
>> I did find somthing in the dbcomlete.py script that comes with it:
>>
>> #!/usr/bin/python
>> import sys
>> if len(sys.argv) != 2:
>>    sys.stderr.write("Please specify one argument - db file to check
>> completeness of\n")
>>    sys.exit(1)
>>
>>
>> dbfile = sys.argv[1]
>>
>> f = open(dbfile)
>>
>> chars = []
>> for line in f.readlines():
>>    chars.append(int(line.rstrip().split(' ')[0].split('_')[1], 16))
>>
>> f.close()
>>
>> for c in range(33,127):
>>    if c not in chars:
>>       print "Missing:", chr(c)
>>
>> for c in chars:
>>    *if c > 126:*
>>       print "Extra char:", c, chr(c)
>>
>> but not sure if thats relevant. I've attached the scripts so that if
>> anyone as any better knowledge they might know whats wrong, and if they
>> want to try it out as opposed to mythccextrator (this script actually ocr's
>> dvb bitmap subs too which can be useful for anyone using dvb-t tuners..)
>>
>> P.s the email with the attachement should arrive later as it is waitng
>> from approval from a moderator.
>>
>
> Sorry for bumping this up again. I was wondering if anyone could tell me
how to look for the errors in a python script and how to go about solving,
i get an error 126, which doesnt show up anywhere in the script. It seems
to fail on the last line.

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20120206/0510cbae/attachment.html 


More information about the mythtv-users mailing list