Quantcast
Channel: configuration - Forum - FlexGet
Viewing all articles
Browse latest Browse all 716

Writing a custom series regexp:

$
0
0

@b1hmpw96 wrote:

I'm trying to write a custom regexp to handle a show that gives me difficulties using the usual 'series' plugin' and have content_filename change the file name before passing it to Deluge.
I have done quite a bit of Googling and there isn't too much information out there for this sort of thing in one place.

Let's say the show comes in this sort of format for my example.

Difficult.Show.2016.11.16.Part.2.mp4

Sometimes it comes in parts, sometimes not. It's the 'parts' that causes problems with the regular series plugin because it will see that it's downloaded the first part, for instance, and not download the second part because it's 'been seen' because the dates are the same.

Here's what I've come up with thus far.

tasks:
  custom:
    regexp:
      accept:
        - '(^Difficult.Show).*':
            set:
              series_name: "{{title|re_replace('(^Difficult.Show)(.*)', '\ \1')}}"
              series_date: "{{title|re_replace('(.*)(\\d{4}.\\d{2}.\\d{2})(.*)', '\\2')}}"
              series_episode: "{{title|re_replace('(.*)([Pp]a?rt.?\\d)(.*)', '\\2')}}"
              content_filename: "{{series_name}}-{{series_date}}-{{series_episode}}" 

    deluge: yes

It does not pass the referenced group to the file name, but the reference itself. ie. \ \1,\ \2. It looks like a wingding character. 00 over 01 or 02 in a square box.
- there is no space between the \ \1 reference in the code line 'series_name'. This page handles it oddly.

Any ideas?
Thanks.

  • running v2.5.16

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 716

Trending Articles