Additional / updated regex to match TV episodes

Hi,

 

 

As I discovered in this thread, there are a number of different patterns that Plex uses to match TV shows outside of the single example provided in the documentation. 

 

Unfortunately, as I also discovered, if I edit that file, changes are reverted and the file is returned to stock state.

 

From the series scraper bundle:

episode_regexps = [
    '(?P.*?)[sS](?P[0-9]+)[\._ ]*[eE](?P[0-9]+)([- ]?[Ee+](?P[0-9]+))?',                           # S03E04-E05
    '(?P.*?)[sS](?P[0-9]{2})[\._\- ]+(?P[0-9]+)',                                                            # S03-03
    '(?P.*?)([^0-9]|^)(?P(19[3-9][0-9]|20[0-5][0-9]|[0-9]{1,2}))[Xx](?P[0-9]+)(-[0-9]+[Xx](?P[0-9]+))?',  # 3x03
    '(.*?)[^0-9a-z](?P[0-9]{1,2})(?P[0-9]{2})([\.\-][0-9]+(?P[0-9]{2})([ \-_\.]|$)[\.\-]?)?([^0-9a-z%]|$)' # .602.
  ]

Specifically, line #11, the comment isn't entirely accurate, as it's actually willing to match 3x03-3x04 (S03E03 and S03E04), not just 3x03.

 

What would be nice would be if it would also match 3x03x04, as many other automated scanners do.

 

Thanks,

deeps

 

 

 

Unfortunately, as I also discovered, if I edit that file, changes are reverted and the file is returned to stock state.

Add the file to another directory, and in the Plug-In directory, add a symbolic link

And BTW....Nice post

/Tommy

Symlinks? Running PMS on windows :confused:

Symlinks? Running PMS on windows :/

Not to worry, I won't tell ;)

And take a peek here, just googled, but not tested with Plex though...Been a Linux dude

http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

/T

Hi dane22,

Thanks for the info. As Chris has pointed out on the other post, unfortunately, this would prevent me from receiving any future updates to this package.

At the risk of cross posting, but for completeness so that all the relevant information is included in this thread, I have included what I believe the required change below. Affected section is bold/underlined.

My regex isn't the best, but I believe the '?' operator is used to match zero times or once, making it optional, thus changing from:

  1. (?P.*?)([^0-9]|^)(?P(19[3-9][0-9]|20[0-5][0-9]|[0-9]{1,2}))[Xx](?P[0-9]+)(-[0-9]+[Xx](?P[0-9]+))?', # 3x03

to:

  1. (?P.*?)([^0-9]|^)(?P(19[3-9][0-9]|20[0-5][0-9]|[0-9]{1,2}))[Xx](?P[0-9]+)((-[0-9]+)?[Xx](?P[0-9]+))?', # 3x03

Thanks,

deeps

How about creating an account on Github, and then fork this repo:

https://github.com/plexinc-plugins

Then make your changes, and issue a pull request

/Tommy

Fantastic idea. I did not know about that repo. I will do that as soon as I figure out git!

Thanks again Tommy!

Cheers,

deeps

I will do that as soon as I figure out git!

https://plexapp.zendesk.com/hc/en-us/sections/200308733-Channel-Development

Check out this part: https://plexapp.zendesk.com/hc/en-us/articles/201382293-A-GitHub-Guide-To-Fixing-a-Channel

/Tommy

Pull request complete! :-) Now just the waiting game to hope it gets accepted and released!

Thanks again for all the help!