[mythtv-users] Errors from myhproto when using mythvidexport.py

Jay Harbeston jharbestonus at gmail.com
Tue Aug 25 20:47:08 UTC 2020



> On Aug 25, 2020, at 4:04 PM, Roland Ernst <rcrernst at gmail.com> wrote:
> 
> 
> 
> On Tue, Aug 25, 2020 at 4:49 PM Jay Harbeston <jharbestonus at gmail.com <mailto:jharbestonus at gmail.com>> wrote:
> 
> 
>> On Aug 25, 2020, at 6:18 AM, Roland Ernst <rcrernst at gmail.com <mailto:rcrernst at gmail.com>> wrote:
>> 
>> 
>> On Tue, Aug 25, 2020 at 11:48 AM Stephen Worthington <stephen_agent at jsw.gen.nz <mailto:stephen_agent at jsw.gen.nz>> wrote:
>> On Mon, 24 Aug 2020 13:25:27 -0400, you wrote:
>> 
>> >
>> >Any ideas where I need to check? Or? 
>> >
>> 
>>  
>> This seems to be a leftover from the python3 conversion
>> for mythtv v31+.
>> 
>> If the storage groups of the recording and video is local,
>> i.e.: on the same PC mythvidexport is running, please try
>> the following:
>> 
>> - locate the installed file mythproto.py from the Python
>>   Bindings (mine is in the location below)
>> 
>> - in terminal, run the following commands 
>>   (change the path to mythproto.patch)
>>  
>> {{{
>> $ cd /usr/lib/python3/dist-packages/MythTV/
>> $ ls ./mythproto.py
>> $ sudo cp ./mythproto.py ./mythproto.org <http://mythproto.org/>
>> $ sudo patch < /path/to/mythproto.patch
>> $ sudo python3 -m compileall ./mythproto.py
>> }}}
>> 
>> Note, that this will be overwritten again when updating
>> mythtv.
>> 
>> Please report back the result.
>> On success, I will update the Python Bindings asap.
> 
> 
> I found earlier that I needed to add a ‘/‘ between the path and the file name to avoid the error below.  I tried setting the path with a leading ‘/‘ to avoid the issue, but that didn’t work as the ‘/‘ was stripped off earlier.  
> 
>     FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/mythtv/recordings44303_20200811220000.mp4’
> 
> 
> I tweaked the open statement to put in +’/‘ immediately after the sg.dirname to add the ‘/‘  separator and it works great!
> 
> If you can add the directory separator into the code somewhere, all will be good!
> 
> Thanks!
> 
> Jay
> 
> 
> You are describing two different failures / bugs:
> 
> 1) The trailing path separator is missing on some entries in the storagegroup :
> Please post the output of 
> {{{
> MariaDB [mythconverg]> select * from storagegroup;
> }}}

mysql> select * from storagegroup;
+----+-------------+----------+------------------------------+
| id | groupname   | hostname | dirname                      |
+----+-------------+----------+------------------------------+
|  1 | Default     | mythpc   | /var/lib/mythtv/recordings   |
|  3 | Fanart      | mythpc   | /var/lib/mythtv/fanart/      |
|  4 | Trailers    | mythpc   | /var/lib/mythtv/trailers/    |
|  5 | Coverart    | mythpc   | /var/lib/mythtv/coverart/    |
|  7 | Screenshots | mythpc   | /var/lib/mythtv/screenshots/ |
|  8 | Banners     | mythpc   | /var/lib/mythtv/banners/     |
|  9 | DB Backups  | mythpc   | /var/lib/mythtv/db_backups/  |
| 10 | LiveTV      | mythpc   | /var/lib/mythtv/livetv/      |
| 11 | Streaming   | mythpc   | /var/lib/mythtv/streaming/   |
| 19 | Videos      | mythpc   | /var/lib/mythtv/videos/      |
+----+-------------+----------+------------------------------+
10 rows in set (0.00 sec)

mysql> 


> Until v.30, all storage group entries had a trailing slash ('/') in the database.
> My test setup for v31 shows a mixed scenario, with and without trailing slashes.
> Everything was set up by the 'mythtv-setup' program, no direct sql edits. 
> This would affect all mythtv versions, regardless if they use python2 or python3.
> Finding all occurrences of this missing separator inside the Python Bindings could be a lot of work.
> I do not know if php/mythweb and perl bindings are affected here, too.
> The correct python fix will be something like 
> {{{
> os.path.join(sg.dirname, filename)
> }}}
>  
> 2) Opening a file with the MythTV Python Bindings is not done in binary mode.
> This only affects python3 and mythtv v31+ 
> 


I can see now that the path needs to be updated for the default, and once I update the default path, 
 the current code with the mods for the binary, but without the +’/‘ should be fine.

Thanks!

Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200825/304bf1d4/attachment.htm>


More information about the mythtv-users mailing list