2023-01-09, 00:49
How do I get the full file name and path of a ‘TV Show’ recording within a Python addon?
I am using KODI v19.4.0 on LibreELEC v10.0.3.
I’m writing my first Kodi addon. It is a TV scraper using python. When I ‘Scan for new content’, I can see the log entries that I expect, so I know that the basics are working. My scraper is heavily based on the ‘metadata.demo.tv’ demo addon found in Github.
The source that I am trying to scrape has 2 files per recording, one is the actual media and the other contains the EPG data. For example: ‘my recording name.mpg’ and ‘my recording name.mpg.inf’.
I need to be able to get the full file name and path of the recording currently being scraped so that I can open the associated information file, extract the required EPG details and return them to Kodi.
My addon is receiving both the ‘find’ and ‘getdetails’ actions. With ‘find’, the closest I get is the ‘title’ which is just the recording file name without the file extension, in my previous example it would be ‘my recording name’.
With both actions, the ‘pathSettings’ property always seems to be a null object. With ‘getdetails’, the url is always just ‘/path/to/show’ regardless of where the actual recording is located.
I would appreciate some help or guidance in obtaining the full path and file name. Alternatively, perhaps I don’t understand KODI well enough and a scraper is the wrong strategy in this instance and a different approach can be suggested.
Thanks in advance.
I am using KODI v19.4.0 on LibreELEC v10.0.3.
I’m writing my first Kodi addon. It is a TV scraper using python. When I ‘Scan for new content’, I can see the log entries that I expect, so I know that the basics are working. My scraper is heavily based on the ‘metadata.demo.tv’ demo addon found in Github.
The source that I am trying to scrape has 2 files per recording, one is the actual media and the other contains the EPG data. For example: ‘my recording name.mpg’ and ‘my recording name.mpg.inf’.
I need to be able to get the full file name and path of the recording currently being scraped so that I can open the associated information file, extract the required EPG details and return them to Kodi.
My addon is receiving both the ‘find’ and ‘getdetails’ actions. With ‘find’, the closest I get is the ‘title’ which is just the recording file name without the file extension, in my previous example it would be ‘my recording name’.
With both actions, the ‘pathSettings’ property always seems to be a null object. With ‘getdetails’, the url is always just ‘/path/to/show’ regardless of where the actual recording is located.
I would appreciate some help or guidance in obtaining the full path and file name. Alternatively, perhaps I don’t understand KODI well enough and a scraper is the wrong strategy in this instance and a different approach can be suggested.
Thanks in advance.