Failed to fetch : How to exclude years from tvdb search ?

Any questions? Need some help?
Post Reply
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

Hi,

I'm trying to rename this filename : Avenue.5.2020.S01E06.VO.HDTV.x264.mp4
Rename episodes using [TheTVDB]
Auto-detected query: [avenue 5 2020, 5 2020]
CmdlineException: Multiple queries: Processing multiple shows at once requires -non-strict matching: [avenue 5 2020, 5 2020]
This show is available by typing "avenue 5"
> https://thetvdb.com/search?query=avenue%205

But not "avenue 5 2020"
> https://thetvdb.com/search?query=avenue%205%202020

<--->

I have same problem with : Traces.2019.S01E02.VO.HDTV.x264.mp4
Rename episodes using [TheTVDB]
Auto-detected query: [traces 2019]
Failed to fetch episode data: [traces 2019]
CmdlineException: Failed to match files to episode data
This show is available by typing "traces"
> https://thetvdb.com/search?query=traces

But not "traces 2019"
> https://thetvdb.com/search?query=traces%202019

<--->

I have another problem with this type of filename : The.Magicians.US.S05E08.VO.WEBRip.x264.mp4

The show is named "The Magicians"
> https://thetvdb.com/series/the-magicians-2015

In the filename you can see ".US." // it's means "US show" (maybe there is UK show or similar)

Problem is filebot search for the magicians US
> https://thetvdb.com/search?query=the+magicians+US

<--->

I know I can rename this filename : Avenue.5.2020.S01E06.VO.mp4 to Avenue.5.S01E06.VO.mp4

But I would prefer to exclude "2020" or "2019" or "US" or others words from tvdb search, is it possible?

Regards
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by rednoah »

Sorry, the current behaviour is required for some use cases go actually get the correct match. Oddly enough, the examples here work exactly the other way around.

:arrow: Best to report the issue on the TheTVDB Forums so they can fix the issue in their search engine or alternatively add the necessary alias names.


EDIT:

Oddly enough, it works for me:

Code: Select all

filebot -rename *.mp4 -non-strict --log INFO --action TEST
[TEST] from [Avenue.5.2020.S01E06.VO.HDTV.x264.mp4] to [Avenue 5 - 1x06 - Was It Your Ears.mp4]
[TEST] from [The.Magicians.US.S05E08.VO.WEBRip.x264.mp4] to [The Magicians (2015) - 5x08 - Garden Variety Homicide.mp4]
[TEST] from [Traces.2019.S01E02.VO.HDTV.x264.mp4] to [Traces - 1x02 - Episode 2.mp4]
Perhaps try the latest beta for good measure?
viewtopic.php?t=1609
:idea: Please read the FAQ and How to Request Help.
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

Well, you are right ! I updated to lasted version 4.9 and all is fine now ! Woohoo !

Thank you ! Next time I will update before posting :)
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

Hi,

Me again for same problem :|

I use last version : 4.9.2

Here is my command script :
filebot -script fn:amc "/playhere/here/" -non-strict --output "/playhere/here2/"
Here are my TV SHOW
Monsterland.2020.S01E01.WEBRip.x264.mp4
The.Good.Lord.Bird.2020.S01E01.WEBRip.x264.mp4
The.Queens.Gambit.2020.S01E01.WEBRip.x264.mp4
The.Right.Stuff.2020.S01E04.WEBRip.x264.mp4
Here is my result with TEST command (filebot -rename *.mp4 -non-strict --log INFO --action TEST)
[TEST] from [/playhere/here/Monsterland.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Motherland Fort Salem - 1x01 - Say the Words.mp4]
[TEST] from [/playhere/here/The.Good.Lord.Bird.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The End - 1x01 - Do Not Resuscitate.mp4]
[TEST] from [/playhere/here/The.Queens.Gambit.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Queens - 1x01 - Elaina.mp4]
[TEST] from [/playhere/here/The.Right.Stuff.S01E04.WEBRip.x264.mp4] to [/playhere/here2/The Fortnight - 1x04 - When You Were Young.mp4]
"Monsterland" become "Motherland Fort Salem"
"The Good Lord Bird" become "The End"
"The Queen's Gambit" become "Queens"
"The Right Stuff" become "The Fortnight"

Can you help me to have correct issue ?

Regards
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by rednoah »

Different series. Different file path. Different problem. There'll always be a corner case that doesn't work.


Typically, I would recommend using the --filter option to fine-tune things for your specific use case, e.g. since you're only processing recently aired episodes, the age filter approach might work well for you:
viewtopic.php?t=2127


However, in this case, it does work correctly out-of-the-box for me here:

Code: Select all

$ filebot -rename *.mp4 -non-strict --action TEST --log INFO
[TEST] from [Monsterland.S01E01.WEBRip.x264.mp4] to [Monsterland - 1x01 - Port Fourchon, Louisiana.mp4]
[TEST] from [The.Good.Lord.Bird.S01E01.WEBRip.x264.mp4] to [The Good Lord Bird - 1x01 - Meet the Lord.mp4]
[TEST] from [The.Queens.Gambit.S01E01.WEBRip.x264.mp4] to [The Queen's Gambit - 1x01 - Openings.mp4]
[TEST] from [The.Right.Stuff.S01E04.WEBRip.x264.mp4] to [The Right Stuff - 1x04 - Advent.mp4]

:!: If you process a series / episode before the series / episode information is available in the database, then FileBot will end up with the "next best" match as per -non-strict matching. This may be a possible explanation, but we can't say for sure without reproducing the issue. Processing files 2-3 days after release, instead of immediately, may alleviate this particular issue.


:!: If you're running tests on previously incorrectly renamed files, then you'll want to check and clear xattr, otherwise FileBot will tend to prefer the previous match. Please read Metadata and Extended Attributes for details.
:idea: Please read the FAQ and How to Request Help.
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

First, Thank you very much for answering !

I did TEST again and I added -no-xattr to the command line
filebot -rename *.mp4 -non-strict -no-xattr --action TEST --log INFO

Now it's found correctly !
[TEST] from [/playhere/here2/Monsterland.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Monsterland - 1x01 - Port Fourchon, Louisiana.mp4]
[TEST] from [/playhere/here2/The.Good.Lord.Bird.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Good Lord Bird - 1x01 - Meet the Lord.mp4]
[TEST] from [/playhere/here2/The.Queens.Gambit.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Queen's Gambit - 1x01 - Openings.mp4]
[TEST] from [/playhere/here2/The.Right.Stuff.S01E04.WEBRip.x264.mp4] to [/playhere/here2/The Right Stuff - 1x04 - Advent.mp4]
I added to my main command
filebot -script fn:amc "/playhere/here/" -non-strict -no-xattr --output "/playhere/here2/"
Question : Can I leave this attribut "-no-xattr" to my command script? it will not be a problem?

Big Thanks !
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by rednoah »

:!: :!: :!: -no-xattr has no effect on new files, because new files don't have xattr. :!: :!: :!:


:idea: If -no-xattr has an effect, then that just means the file has previously been processed and tagged by FileBot already, and so -no-xattr merely enables a clean test case, but won't have any special effect on new untagged files.


:idea: Note that you should use filebot -revert to revert files to their original file names if you find mismatched files. If you manually revert file paths, then you will likely forget to clear xattr, which can then negatively affect future filebot runs. If you correctly revert files, then this won't be an issue.


:idea: If files are xattr tagged correctly, then that will positively affect future filebot runs. So you generally want FileBot to write xattr because if you disable xattr you will later regret it for one reason or another.


:idea: Please read Metadata and Extended Attributes for details.
:idea: Please read the FAQ and How to Request Help.
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

Right I understand now thank you :)
So I removed -no-xattr from my bash script

I know what is the problem, let me explain again :
Many files have year inside name :
Monsterland.2020.S01E01.WEBRip.x264.mp4
The.Good.Lord.Bird.2020.S01E01.WEBRip.x264.mp4
The.Queens.Gambit.2020.S01E01.WEBRip.x264.mp4
The.Right.Stuff.2020.S01E04.WEBRip.x264.mp4
With "2020" > it does NOT match the right tv show
here is TEST with 2020
filebot -rename *.mp4 -non-strict --action TEST --log INFO
[TEST] from [/playhere/here2/Monsterland.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Motherland Fort Salem - 1x01 - Say the Words.mp4]
[TEST] from [/playhere/here2/The.Good.Lord.Bird.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The End - 1x01 - Do Not Resuscitate.mp4]
[TEST] from [/playhere/here2/The.Queens.Gambit.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Queens - 1x01 - Elaina.mp4]
[TEST] from [/playhere/here2/The.Right.Stuff.2020.S01E04.WEBRip.x264.mp4] to [/playhere/here2/The Fortnight - 1x04 - When You Were Young.mp4]
If I remove "2020" > it does match the right tv show
here is TEST without 2020
filebot -rename *.mp4 -non-strict --action TEST --log INFO
[TEST] from [/playhere/here2/Monsterland.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Monsterland - 1x01 - Port Fourchon, Louisiana.mp4]
[TEST] from [/playhere/here2/The.Good.Lord.Bird.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Good Lord Bird - 1x01 - Meet the Lord.mp4]
[TEST] from [/playhere/here2/The.Queens.Gambit.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Queen's Gambit - 1x01 - Openings.mp4]
[TEST] from [/playhere/here2/The.Right.Stuff.S01E04.WEBRip.x264.mp4] to [/playhere/here2/The Right Stuff - 1x04 - Advent.mp4]
Problem is : I can't rename the main file, because it's seeding for 24/48hours (I have to keep it for ratio)
I tried to check if it's possible to disable "2020" from the query search .. but it's look like not possible.

I see that you have a "Query Exclude" list
> https://github.com/filebot/data/blob/ma ... cludes.txt

but YOU have to add new word, I can't manage this list right ?

My solution is to wait for 24hours .. but it's not what I expect :oops:

Do you have solution for me please ?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by rednoah »

1.
We would expect a search for monsterland 2020 to yield at least 1 good result. TheTVDB search incorrectly doesn't yield any good results for a perfectly good search query. It might start working after a while though.

In this case --db TheMovieDB::TV performs better:

Code: Select all

filebot -rename *.mp4 --db TheMovieDB::TV -non-strict --action TEST --log INFO
[TEST] from [Monsterland.2020.S01E01.WEBRip.x264.mp4] to [Monsterland - 1x01 - Port Fourchon, LA.mp4]


2.
If all your files follow the Name.Year naming pattern, then you can use --q query expressions to select the query string from the filename via your own custom code:
viewtopic.php?t=12043

Code: Select all

filebot -rename *.mp4 --q "{fn.before(/[0-9]{4}/)}" --db TheTVDB -non-strict --action TEST --log INFO
[TEST] from [Monsterland.2020.S01E01.WEBRip.x264.mp4] to [Monsterland - 1x01 - Port Fourchon, Louisiana.mp4]


3.
rednoah wrote: 26 Oct 2020, 02:48 Typically, I would recommend using the --filter option to fine-tune things for your specific use case, e.g. since you're only processing recently aired episodes, the age filter approach might work well for you:
viewtopic.php?t=2127
The generic answer for any kind of mismatch is to use --filter to make the problem space smaller:
rednoah wrote: 27 Oct 2014, 20:54 If you only process recently aired episodes you could exclude any episode of any show that has been aired more than a few days ago, immediately eliminating any and all potential mismatches with similarly named TV Shows aired at different times.

Code: Select all

--filter "age < 7"
:idea: Please read the FAQ and How to Request Help.
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

I already tried --filter "age < 7" but without success...
Failed to identify or process any files
Finished without processing any files
Problem seems to be with "numeric query" like "2019" / "2020" etc..

I suggest to add feature to skip some query word ?
I was looking for something to put into my command line like : "-StopQuery : 2020" (or something like that)
Which would not add "2020" to the TheTVDB query, you see ?

Or maybe add years into the query-excludes files ? https://github.com/filebot/data/blob/ma ... cludes.txt

Well, we are ok to say that TheTVDB search function is not really good too ...

EDIT : I will try your 2. option (I think it"s what I suggested)
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

Only "Monsterland" worked maybe because it's only one word to found... I don't know
filebot -rename *.mp4 --q "{fn.before(/[0-9]{4}/)}" --db TheTVDB -non-strict --action TEST --log INFO

[TEST] from [/playhere/here2/Monsterland.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/Monsterland - 1x01 - Port Fourchon, Louisiana.mp4]
[TEST] from [/playhere/here2/The.Good.Lord.Bird.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Good Cop - 1x01 - Who Framed the Good Cop.mp4]
[TEST] from [/playhere/here2/The.Queens.Gambit.2020.S01E01.WEBRip.x264.mp4] to [/playhere/here2/The Queens Project - 1x01 - Birthday T.mp4]
[TEST] from [/playhere/here2/The.Right.Stuff.2020.S01E04.WEBRip.x264.mp4] to [/playhere/here2/The right to love - 1x04.mp4]

I tried this too
filebot -rename *.mp4 --q "{fn.before(/[0-9]{4}/)}" --db TheMovieDB::TV -non-strict --action TEST --log INFO
Failed to fetch episode data: [The.Good.Lord.Bird.]
Failed to fetch episode data: [The.Queens.Gambit.]
Failed to fetch episode data: [The.Right.Stuff.]
Maybe the last dot is problem? (I don't know How to remove it from query :s )

Edit I found how to remove the DOT
filebot -rename *.mp4 --q "{fn.before(/.[0-9]{4}/)}" --db TheMovieDB::TV -non-strict --action TEST --log INFO
Failed to fetch episode data: [The.Good.Lord.Bird]
Failed to fetch episode data: [The.Queens.Gambit]
Failed to fetch episode data: [The.Right.Stuff]
So I tried with this command : filebot -rename *.mp4 --q "{fn.before(/.[0-9]{4}/)}" -non-strict --action TEST --log INFO
But still does not work .. I don't understand now .. :D
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by rednoah »

Your query expression will probably need to clean up the search query as well, e.g. replace dot with space:

Code: Select all

--q "{fn.before(/[0-9]{4}/).replace('.', ' ').trim()}"

:!: Note that you do not need to use --q at all if you are using --db TheMovieDB::TV because the latter allows for (and yields better results with) Name Year search queries.
:idea: Please read the FAQ and How to Request Help.
nux
Posts: 8
Joined: 01 Mar 2020, 13:05

Re: Failed to fetch : How to exclude years from tvdb search ?

Post by nux »

You are my Lord !

Everything works perfectly !

Big Thanks and sorry, i'm not developper .. and my english is not good too :)
Post Reply