Help needed: Improving EyeTV scanner

Hi,



I’m trying improve one outstanding issue in EyeTV scanner where file that is being exported by EyeTV gets scraped with Plex.



While EyeTV is exporting, .m4v file has busy appended to start of file name. When EyeTV is done exporting it renames this file and removes busy from its name.

I’m trying to tell scanner to ignore any file that starts with busy but I guess i’m not doing it properly. My edited text is below in bold:



import re, os, os.path, sys<br />
import Media, VideoFiles, UnicodeHelper, unicodedata, plistlib<br />
<br />
def Scan(path, files, mediaList, subdirs):<br />
        ToRemove = []<br />
        paths = path.split('/')<br />
        if len(files) >= 1:<br />
                if path.endswith(".eyetv") and not path.endswith("Live TV Buffer.eyetv"):<br />
                        OkRecording = None<br />
                        for i in files:<br />
                                if i.endswith(".iPad.m4v") and not path.startswith("busy"):<br />
                                        recording = i<br />
                                if i.endswith(".eyetvp"):<br />
									OkRecording = True<br />
<br />
                        if OkRecording:<br />
                                movie = Media.Movie(i)<br />
                                movie.parts.append(recording)<br />
                                mediaList.append(movie)



Anyone know how to ignore all files that start with **busy**?

have you tried using wildcards on your code for how it looks at filenames?

Not sure where to use wildcard…



  if i.endswith(".iPad.m4v") and not path.startswith("busy"):<br />



I think this line needs to be changed as **path.startswith** is probably taking into account whole path, therefore parent folder as well.

I’m a programmer but don’t know Python, but here are two suggestions:


  1. The following line:



    paths = path.split(’/’)



    Seems to take the full path, such as /Volumes/Something/Somewhere/EyeTV Archive/Your Show.eyetv/busyYour Show.m4v, and split it into the various blocks. If you check that the last element of paths starts with “busy”, this should take care of it. Unfortunately I don’t know the best syntax to do that in Python.


  2. If that doesn’t work, try a substring search against paths, such as using the function path.find("/busy"). A regex search would be even better, in case you know how to use them. The regular expression you would want, I think, is: /busy[^/]*.m4v



    Hope that helps!!!

Thanks for suggestions. I’ve tried your no.1 suggestion but did not get it to work. I hate reg expressions so I’m not gonna even attempt no.2 :slight_smile:



In the meantime i’ve set up Hazel to watch my eyeTV folder and MOVE the recording once EyeTV is done exporting.


Is anyone working on the EyeTV scanner? Is there a forum somewhere else?



I’m a seasoned programmer (wrote my first program back in 1982…), though still learning the more proper Pythonic ways, but I’m completely new to Plex scanners.



Anyway, I’d like to take a stab on the EyeTV scanner and make it more useful with my (already working) Plex for Samsung. Hence, learning to know what’s going on in the community would be nice.



–Pekka

This forum is about it. You’ve got “Agents” and “Scanners” sub-forums.



Best way to learn about scanners is to look through existing ones in you PMS directory or this forum.




Ok, thanks!



As a starter, I set up a github repo for this. It now contains just the Scanners and the Info agent plug-in combined into a Python package that installs itself into the right directories.



GitHub - pekkanikander/Plex-EyeTV-Tools: Plex EyeTV Tools: Scanner and Agent (information) Bundle



There is even a Readme, with instructions how to install. You should be able to edit setup.cfg if you want to install it somewhere else but your own user account.



The Scanners and the Info agent plug-in are still more placeholders than actual design, but I thought it would be best to start with an installer, as people in the user forums seem to have had problems with installation.



I’m next planning make the scanners mere facades that call real functionality on the bundle code side. That may not make sense from the process structure point of view (as plugins are run as separate processes, and scanners as part of the PMS Scanner, if I understand correctly), but OTOH my understanding is that scanners cannot have options while an agent plug-in can.


I’ve had a look at the Github mentioned above, and it looks like a good centralised location for all EyeTV-Plex content…



Just one question… all of the EyeTV threads i have read (and tried) have all focused on scanners for either Movies or TV Shows… My problem, or i guess what i am looking for - at its most simplest - is a scanner that just provides me with all of my EyeTV archive content without trying to match. IE Shows Filename as is, shows date of recording, sorts to show most recent content first, perhaps shows a thumbnail (but not really important)…



All of the scanners/python scripts i have found seam to have multiple multiple versions and personal tweaks, but all focus on scanning and matching - which i don’t know how relevant is for me as i’m in Aus… (BTW i have tried the movies scanner, and the TV shows scanner… and finally i have also tried adding a new MOVIES section, with PLEX MOVIE SCANNER as Scanner, and metadata agent as freebase & personal… Freebase allows me to get to all content, but when i have 5 recording with the same first part of their name, i can’t see (at least on iOS) the part of the same to tell me which part of the series it was… if i use personal, it only uses the mpg file, which results in filenames like 95735dhgsrt.mpg).



So in short is their a scanner that can grab all of the metadata from an eyetv recording and show the file as though they are first class citizens in Plex ? Nothing fancy, just the files ordered by date with readable names would be amazing. Any and all help appreciated. if it doesn’t already exist and there are some great tutorials as to how to build a scanner using python, i can give it a crack…



Cheers.

I know this thread is kind of old but I’ve been messing around with some Python for the ComSkip interface for OS X the last few days so let me stab at this:



Try replacing:


if i.endswith(".iPad.m4v") and not path.startswith("busy"):


with:

if i.endswith(".iPad.m4v") and not i.startswith("busy"):



I don't think you want path.startswith, you want i.startswith since that would assumably be the full filename.

Also IllusionVK:
Have you tried a Home Movies section with either the TV or Movie scanner? As I undersand the way Home Movies works it is much more forgiving.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.