Delete strings from filenames

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
kramaga
Posts: 2
Joined: 18 Apr 2020, 23:34

Delete strings from filenames

Post 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
Last edited by kramaga on 19 Apr 2020, 17:07, edited 5 times in total.
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Delete strings from filenames

Post 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.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1027
Joined: 15 May 2014, 16:17

Re: Delete strings from filenames

Post 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"
User avatar
rednoah
The Source
Posts: 18995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Delete strings from filenames

Post 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
:idea: Please read the FAQ and How to Request Help.
kramaga
Posts: 2
Joined: 18 Apr 2020, 23:34

Re: Delete strings from filenames

Post by kramaga »

Thank you for your replies.

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

Problem solved.
Post Reply