in reply to Please review this: code to extract the season/episode or date from a TV show's title on a torrent site

Note to self: Regexp::Common::time provides the time regex, not Regexp::Common.

One would be lucky to always have the date as year-month-day as the only variation instead of other two. So I take it then the files not matching your season-episode regex, would have the date only in that format?.

  • Comment on Re: Please review this: code to extract the season/episode or date from a TV show's title on a torrent site

Replies are listed 'Best First'.
Re^2: Please review this: code to extract the season/episode or date from a TV show's title on a torrent site
by Cody Fendant (Hermit) on Aug 18, 2016 at 09:40 UTC

    That's a really tricky question.

    I don't see many other date formats, and there's really no way, in code at least, to deal with the possibility that someone has got the month and date the wrong way round and their August 1 is really January 8.

      You could look at consecutively-numbered episodes and see if they are 1 week (or whatever) apart. Or at least that each later-numbered episode has a later date.

        They don't have numbers at all, I'm afraid, so there's no "consecutive" data to be accessed. This is shows like the Daily Show which are normally found in a form like The.Daily.Show.2016.08.15.Daniel.Radcliffe.HDTV.x264-W4F[eztv].mkv (recent example).

      Yup ... may need to account for idiosyncrasies per provider, say by assigning a different regex/parser.