Capital letters on file extensions

Any questions? Need some help?
Post Reply
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Capital letters on file extensions

Post by Clint »

Lately I've seen that I get capital letters on file extensions in my media bank that comes from filebot. It really messes up some scripts I have running on the files and I've had to do some ad-hoc stuff after filebot. Is this something you are aware of? The files comes in with small letters and spits out from filebot process with only the file extension in capitals, the name is still small. I havent bothered you yet because I wanted to wait until I plugged in a new install, but I'm just freshly installed and the first file that gets process today looks like this:

Elysium (2013).MKV

Any ideas?

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

Re: Capital letters on file extensions

Post by rednoah »

GUI or CLI? Console logs?
:idea: Please read the FAQ and How to Request Help.
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

CLI, but I can't find the logs?
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

Found the log:

Code: Select all

Parameter: subtitles = se
Parameter: artwork = y
Parameter: music = n
Parameter: clean = y
Parameter: xbmc = 192.168.1.101
Argument: /share/downloads/Finished
Input: /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/[email protected]
[email protected] [series: Elysium, movie: Elysium (2013)]
Exclude Series: Elysium
Group: [tvs:null, mov:Elysium (2013), anime:null] => [[email protected]]
Get [Northern Sami] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Lookup by hash failed: SubLanguageID for 'northern sami' not found
Searching for [Elysium] at [OpenSubtitles]
Search for [Elysium] failed: SubLanguageID for 'northern sami' not found
No matching subtitles found: /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/[email protected]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/[email protected]]
[MOVE] Rename [/share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/[email protected]] to [/share/MEDIA/Movies/Elysium (2013)/Elysium (2013).MKV]
Processed 1 files
Fetching artwork for /share/MEDIA/Movies/Elysium (2013) from TheMovieDB
Fetching /share/MEDIA/Movies/Elysium (2013)/poster.jpg => {category: posters, width: 1000, height: 1500, language: en, url: http://image.tmdb.org/t/p/original/tHkjoAxmhp3Eau1h0Ir7maKMwUz.jpg}
Fetching /share/MEDIA/Movies/Elysium (2013)/fanart.jpg => {category: backdrops, width: 1920, height: 1080, language: null, url: http://image.tmdb.org/t/p/original/vSbjlX9y8S2hKNURHEO4GsoIOay.jpg}
Fanart not found: /share/MEDIA/Movies/Elysium (2013)/clearart.png / movieart
Fetching /share/MEDIA/Movies/Elysium (2013)/logo.png => {type=movielogo, id=29827, url=http://assets.fanart.tv/fanart/movies/68724/movielogo/elysium-5161bd65f0999.png, lang=en, likes=1}
Fetching /share/MEDIA/Movies/Elysium (2013)/disc.png => {type=moviedisc, id=30143, url=http://assets.fanart.tv/fanart/movies/68724/moviedisc/elysium-51674a393cc19.png, lang=en, likes=4, disc_type=bluray}
Notify XBMC: 192.168.1.101
NoRouteToHostException: No route to host
NoRouteToHostException: No route to host
Clean clutter files and empty folders
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/Collaboration-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/Collaboration-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/Engineering.Utopia-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/Engineering.Utopia-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Journey.to.Elysium-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Journey.to.Elysium-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Technology.of.2154-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Technology.of.2154-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Visual.Effects.of.Elysium-Grym@BTNET/[email protected]
Delete /share/downloads/Finished/Elysium.2013.Bluray.1080p.DTS-HD-7.1.x264-Grym@BTNET/Elysium.Extras-Grym@BTNET/The.Visual.Effects.of.Elysium-Grym@BTNET/[email protected]
Done ヾ(ï¼ âŒ’ãƒ¼âŒ’ï¼ )ノ
It seems the file extension was with capital letters when going in the filebot process. I thought the naming convention for filebot didn't care about that, but always renamed them the same independent of initial name?

Oh yes, while I'm having a log up there. It seems Filebot is looking for "northern sami" subtitles which can't be right. I have add the "se" switch for swedish and northern sami is a very different language. It is a innuit kinda language spoken way up north in scandinavia by only a handful people :lol:
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

Got another one:

Code: Select all

Parameter: subtitles = se
Parameter: artwork = y
Parameter: music = n
Parameter: clean = y
Parameter: xbmc = 192.168.1.101
Argument: /share/downloads/Finished
Input: /share/downloads/Finished/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET)/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV
Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV [series: null, movie: Midnight Cowboy (1969)]
Group: [tvs:null, mov:Midnight Cowboy (1969), anime:null] => [Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV]
Get [Northern Sami] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Lookup by hash failed: SubLanguageID for 'northern sami' not found
Searching for [Midnight Cowboy] at [OpenSubtitles]
Search for [Midnight Cowboy] failed: SubLanguageID for 'northern sami' not found
No matching subtitles found: /share/downloads/Finished/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET)/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/downloads/Finished/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET)/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV]
[MOVE] Rename [/share/downloads/Finished/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET)/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET).MKV] to [/share/MEDIA/Movies/Midnight Cowboy (1969)/Midnight Cowboy (1969).MKV]
Processed 1 files
Fetching artwork for /share/MEDIA/Movies/Midnight Cowboy (1969) from TheMovieDB
Fetching /share/MEDIA/Movies/Midnight Cowboy (1969)/poster.jpg => {category: posters, width: 972, height: 1539, language: en, url: http://image.tmdb.org/t/p/original/cwC4TUi7nfpGDEdk4zRem4aSUmY.jpg}
Fetching /share/MEDIA/Movies/Midnight Cowboy (1969)/fanart.jpg => {category: backdrops, width: 1920, height: 1080, language: null, url: http://image.tmdb.org/t/p/original/6bkR6eMCafikq0Nvi665MwsUddk.jpg}
Fanart not found: /share/MEDIA/Movies/Midnight Cowboy (1969)/clearart.png / movieart
Fanart not found: /share/MEDIA/Movies/Midnight Cowboy (1969)/logo.png / movielogo
Fanart not found: /share/MEDIA/Movies/Midnight Cowboy (1969)/disc.png / moviedisc
Fanart not found: /share/MEDIA/Movies/Midnight Cowboy (1969)/disc.png / moviedisc
Fanart not found: /share/MEDIA/Movies/Midnight Cowboy (1969)/disc.png / moviedisc
Notify XBMC: 192.168.1.101
NoRouteToHostException: No route to host
NoRouteToHostException: No route to host
Clean clutter files and empty folders
Delete /share/downloads/Finished/Midnight.Cowboy.1969.Bluray.1080p.DTS-HD.x264-Grym.(@BTNET)
Done ヾ(@⌒ー⌒@)ノ
This as same as the other one comes out with the extension in capital letters:

Midnight Cowboy (1969).MKV
Last edited by Clint on 23 Feb 2014, 22:09, edited 1 time in total.
User avatar
bonelifer
Power User
Posts: 81
Joined: 23 Mar 2013, 18:27

Re: Capital letters on file extensions

Post by bonelifer »

ISO 639-1 two letter code for Swedish is sv, se is the two letter code for "northern sami".

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
nytram
Posts: 30
Joined: 12 Feb 2014, 04:34

Re: Capital letters on file extensions

Post by nytram »

Hi

You could try adding this to your output format {ext.lower()}
if that doesn't do the trick a slight change to your pattern matching
to include CAPS will definitely work. eg [a-zA-Z] or MKV mkv
depending on how your scripts are written and OS

Regards Martyn
nytram
Posts: 30
Joined: 12 Feb 2014, 04:34

Re: Capital letters on file extensions

Post by nytram »

Hi again
here's a script that will change any files with upper case extension to lower case which you can run prior to your original scripts assuming you are using a Unix derivative.

#!/bin/sh

FILES=$(ls -1)

for FILE in $FILES
do
EXT=$(echo $FILE | awk -F . '{print $NF}')
if [[ $EXT =~ [A-Z]{1,} ]]
then
BASE=${FILE%\.*}
NEWEXT=$(echo $EXT | tr '[:upper:]' '[:lower:]')
if [ ! -e $BASE.$NEWEXT ]
then
mv $FILE $BASE.$NEWEXT
else
echo "Could not rename $FILE to $BASE.$NEWEXT: $BASE.$NEWEXT already exists!"
fi
fi
done

exit 0
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Capital letters on file extensions

Post by rednoah »

r2047 will now force lower-case extensions in CLI mode as well.
:idea: Please read the FAQ and How to Request Help.
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

bonelifer wrote:ISO 639-1 two letter code for Swedish is sv, se is the two letter code for "northern sami".

https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
You are absolutely right! I'm simply to daft to realize that, my mind was in other applications of country codes where se stands for Sweden.
Thanks!
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

nytram wrote:Hi again
here's a script that will change any files with upper case extension to lower case which you can run prior to your original scripts assuming you are using a Unix derivative.

#!/bin/sh

FILES=$(ls -1)

for FILE in $FILES
do
EXT=$(echo $FILE | awk -F . '{print $NF}')
if [[ $EXT =~ [A-Z]{1,} ]]
then
BASE=${FILE%\.*}
NEWEXT=$(echo $EXT | tr '[:upper:]' '[:lower:]')
if [ ! -e $BASE.$NEWEXT ]
then
mv $FILE $BASE.$NEWEXT
else
echo "Could not rename $FILE to $BASE.$NEWEXT: $BASE.$NEWEXT already exists!"
fi
fi
done

exit 0
Nice script! Thanks! :)

I use this with a similar algoritm: (Note: this only works in recent versions of Bash)
#!/bin/bash

while read f; do
if [[ "$f" = *.* ]]; then ()
b="${f%.*}"
x="${f##*.}"
l="${x,,}"
if [[ "$x" != "$l" ]]; then
mv "$f" "$b.$l"
fi
else
continue
fi
done
Clint
Donor
Posts: 50
Joined: 24 Sep 2013, 19:42

Re: Capital letters on file extensions

Post by Clint »

rednoah wrote:r2047 will now force lower-case extensions in CLI mode as well.
Thanks!!! :D :D
Post Reply