Page 1 of 1

Delete strings from filenames

Posted: 19 Apr 2020, 12:35
by kramaga
Hello,

I would like to know if there is a function or a way to remove strings from the filenames after extraction and before filebot compares the filename with TVDB.

Occasionally the name of my series misleads Filebot when there is "720" / "1080" / "264" in the name like for example :

Code: Select all

Input: C:\Users\Bruno\Downloads\Jdownloader\Arifureta.E01.VOSTFR.1080p.WEB.x264-Time2Watch.mkv
Group: {Series=arifureta} => [Arifureta.E01.VOSTFR.1080p.WEB.x264-Time2Watch.mkv]
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [Arifureta]
Fetching episode data for [Arifureta Shokugyou de Sekai Saikyou]
Fetching episode data for [Arifureta Kiseki]
[MOVE] from [C:\Users\Bruno\Downloads\Jdownloader\Arifureta.E01.VOSTFR.1080p.WEB.x264-Time2Watch.mkv] to [F:\Series\Animes\Arifureta Shokugyou de Sekai Saikyou\Saison 02\Arifureta Shokugyou de Sekai Saikyou - 2x01 - TBA.mkv]
Processed 1 files
Notify Kodi: [host:192.168.1.43, port:8080]
POST: http://192.168.1.43:8080/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"Arifureta E01 VOSTFR 1080p WEB x264-Time2Watch","image":"https://app.filebot.net/icon.png"},"id":1}
SocketTimeoutException: Connect timed out
Sending PushBullet report
Clean clutter files and empty folders
Done ヾ(@⌒ー⌒@)ノ
Here's my script ( I tried with the absolute order function but didn't matched correctly either ) :

Code: Select all

@ECHO OFF
 
:: Input Parameters
 
set ARG_PATH=%1
set ARG_NAME=%2
set ARG_LABEL=%3
 
 
:: Configuration
 
 
:: IF "%ARG_LABEL%" NEQ "movie" (filebot -rename %ARG_PATH% --db TheTVDB --order airdate --mapper order.absolute.episode --format "{n} {sxe} [{absolute}]" -non-strict --log-file amc.log)
 
filebot -script fn:amc --lang fr --action move -non-strict --conflict skip  --log-file amc.log --def seriesFormat="F:/Series/{if ( minutes < 31 ) 'Animes' else 'Normales'}/{n}/Saison {s.pad(2)}/{n} - {sxe} - {t}" movieFormat="F:/Films/{n.colon(' - ')} ({y}){' CD'+pi}{subt}" --def clean=y deleteAfterExtract=y unsorted=n music=n artwork=n excludeList=C:\Users\Bruno\AppData\Roaming\FileBot\logs\excludes.txt ut_dir=%ARG_PATH% ut_kind=multi ut_title=%ARG_NAME% ut_label=%ARG_LABEL%
Thanks

Re: Delete strings from filenames

Posted: 19 Apr 2020, 13:03
by rednoah
Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
  • What are you trying to do achieve? What's not working? What have you tried so far?
  • Include screenshots, logs or filenames (i.e. demonstrate the issue)
  • Include System Information (i.e. filebot -script fn:sysinfo console output)
:idea: Please read How to Request Help and Fix Problems, Report Bugs, Get Features.

Re: Delete strings from filenames

Posted: 19 Apr 2020, 18:56
by kim
the problem is E01... how can filebot know what season is correct ?

maybe use:

Code: Select all

--filter "s == 1"

Code: Select all

filebot -list --q "Arifureta" --filter "s == 1"

Re: Delete strings from filenames

Posted: 19 Apr 2020, 19:12
by rednoah
1.
I see. What makes you think it's related to "720" / "1080" / "264" in the name though? Arifureta E01 is all the information we have. Maybe it's Season 1, maybe it's Season 2, without additional information, it's anyones guess. Picking the most recent E01 isn't unreasonable.


2.
Presumably, your files are named based on AniDB information, where the concept of season does not exist, so not having a season number does make sense in the context of AniDB naming.

:arrow: Converting AniDB episode information to TheTVDB episode information is another topic entirely:
viewtopic.php?t=2769

Re: Delete strings from filenames

Posted: 19 Apr 2020, 21:53
by kramaga
Thank you for your replies.

I tried with converting to TheTVDB episode information and it worked !

Problem solved.