POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post by stephen147 »

I'll need to revisit this again when I've time.

It was the only way for me to use them bindings successfully to rename movie and sub files was to have the override extension enabled and then rewrite it back again using {"."+ext}.
Santaspascuas
Posts: 2
Joined: 24 Apr 2017, 13:50

Re: [Mac] Folder Action with Automator

Post by Santaspascuas »

Hi,

I have followed all your steps, and when I run the Automator I get the following error message: "Illegal usage: output folder must exist and must be a directory: "Media".

I have a folder called Media (users/alvaro/Media) *alvaro is my name
Can you help me with this issue? It is my first time writing scripts and I have no clue of the proper spelling of the output route.
Thanks!
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Mac] Folder Action with Automator

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 basic information (i.e. sysinfo 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.
Laynezilla
Posts: 1
Joined: 25 Apr 2017, 04:27

Re: --filter and fine-tuning

Post by Laynezilla »

Is there a complete list of filters anywhere?
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: --filter and fine-tuning

Post by rednoah »

:idea: The number of possible filters is infinite. The available bindings (n, y, s, etc) are the same as in format expressions.

What's the problem? What are you trying to accomplish?
:idea: Please read the FAQ and How to Request Help.
Santaspascuas
Posts: 2
Joined: 24 Apr 2017, 13:50

Re: [Mac] Folder Action with Automator

Post by Santaspascuas »

Hi rednoah, apologies for the lousy help request. I have now read the FAQ and the How to Request Help section. I am sorry if I still make mistakes, because I am not English fluent and I dont understand many of the words and instructions. Here I go:
I am running automator on a Mac Mini, runnin OS Sierra 10.12.4.
I am trying to set Automator to look up the destination folder of Transmission (called "Transmission"), where all the movies and tvshows are dowloaded, and process the media files through Filebot to rename them and send them to the Media folder.
Hopefully, in a second stage I would like to send the renamed files to external hard drives and even get the subtitles, but I dont want to bother you even further.
I have installed the filebot console tools and checked that are working.
When I follow the instructions given by you in this post, I open Automator, I select new Document and select Folder Action.
I click the Choose folder combobox and select the folder "Transmission"
When I paste the shell script arguments exactly as you say ("$HOME/Media"), I get the following error: http://i.imgur.com/ALOgN6r.png
If I write another route (/Users/alvaro/Media), the message is similar (quoting and unquoting): http://i.imgur.com/CAHmOX6.png

I hope I've provided enough information.
Many thanks in advance!
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Mac] Folder Action with Automator

Post by rednoah »

:!: It's a very bad idea to watch active download folders for changes. This could not possibly end well.

The best solution is to have Transmission call FileBot on completed downloads. Here's the setup instructions for that:
viewtopic.php?f=4&t=215#p3380
:idea: Please read the FAQ and How to Request Help.
Effe
Posts: 1
Joined: 15 Sep 2017, 10:05

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by Effe »

I need help with this script.

I followed the guide, I get no error, but the files are not renamed.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post by dadelayer »

Thanks!. I tested it out using the example and it worked fine. However, when I use it with my XML file (I converted the JSON > XML), it says my format is not correct.
I use the same format and code as the example
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post by rednoah »

The example here is very specific. You can learn from it, but you can't copy-and-paste and expect it to work in your case. ;)

If you start by learning how to parse JSON, then you're on the right track:
http://docs.groovy-lang.org/latest/html ... urper.html

:idea: You can hire me though, but you'd need to write down exactly what you need, with examples and example data.
:idea: Please read the FAQ and How to Request Help.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post by dadelayer »

Well, I wanted to try it in XML since I wanted to use your example, but not coming up with anything.

Code: Select all

def fnn = fn
xml = new XmlSlurper().parse(folder+'/mov.xml')
xml.'**'.find { it.name() == 'scid' && it.text() == fnn}*.parent()*.title*.text()
that should return the title but it's not working as its supposed to. I don't have the money to hire :\ it seems expensive :(
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post by rednoah »

Just debug step by step. Does it parse? Is the first element what you think it should be?

You can prototype and debug these things in the Format Editor in minutes. Just try things and narrow down which exact piece of code isn't working as expected. ;)
:idea: Please read the FAQ and How to Request Help.
Delmano
Posts: 1
Joined: 14 Oct 2017, 10:27

Re: Batch Rename any type of file

Post by Delmano »

This is so useful. Thanks for the tutorial Noah, helps newbies like me a lot.
oneguynick
Posts: 7
Joined: 06 Jan 2018, 13:45

Re: Metadata and Extended Attributes

Post by oneguynick »

Code: Select all

filebot -rename *.mp4 --db TVDB -non-strict
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <*> at index 0: *.mp4 (*.mp4)
Failed to read xattr: InvalidPathException: Illegal char <*> at index 0: *.mp4
Failed to read xattr: InvalidPathException: Illegal char <*> at index 0: *.mp4
Failed to read xattr: InvalidPathException: Illegal char <*> at index 0: *.mp4
Failed to read xattr: InvalidPathException: Illegal char <*> at index 0: *.mp4
^C

Example filename: Penoza - S01E02 - Unpleasant Surprises HDTV-720p.mkv
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Metadata and Extended Attributes

Post by rednoah »

*.mp4 refers to all mp4 files. If you're testing with mkv files then *.mkv will select those.

@see https://mywiki.wooledge.org/glob
:idea: Please read the FAQ and How to Request Help.
oneguynick
Posts: 7
Joined: 06 Jan 2018, 13:45

Re: Metadata and Extended Attributes

Post by oneguynick »

My mistake. I forgot they were *.mkv, good catch. With that said I am now testing the same working commands against my samba share with the same issue. Copy locally just isn't an option. Is there a better way to do this? NFS or SFTP or something?
oneguynick
Posts: 7
Joined: 06 Jan 2018, 13:45

Re: Metadata and Extended Attributes

Post by oneguynick »

Alright so I took the network share out of the picture for troubleshooting and tried docker:

Code: Select all

docker run -it -v /tv:/volume1 -v /opt/docker/filebot:/data rednoah/filebot -script fn:xattr -r *
docker run -it -v /tv:/volume1 -v /opt/docker/filebot:/data rednoah/filebot -script fn:duplicates -r --action test *
Done ヾ(@⌒ー⌒@)ノ in both cases. I specifically copied a folder of shows to ensure there were exact duplicates.

I had considered that maybe it was the ZFS pool. I verified the pool is enabled for xattr:

Code: Select all

NAME                                                    PROPERTY  VALUE  SOURCE
share                                                   xattr     on     default
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Metadata and Extended Attributes

Post by rednoah »

NFS might work. SFTP probably doesn't preserve attributes, but RSYNC might (with --xattrs option).

If you're using docker with some host folder mounted into the docker, then there's a good chance xattr won't work. I remember filesystem events not working either. Not sure if that's something that can be enabled or if it's just not supported.

:idea: If you care about xattr, then the best solution is usually to process files on the NAS or server where reading/writing xattr usually works out of the box.

:arrow: FileBot generally doesn't require xattr, it just stores some xattr info if possible, but will work just fine without. It's just that the duplicates script requires them to work, so it'll instantly know which file is which movie/episode without having to bother any web services.
:idea: Please read the FAQ and How to Request Help.
yhm28
Posts: 20
Joined: 24 Jan 2018, 07:20

Re: Batch Rename any type of file

Post by yhm28 »

rednoah wrote: 13 Oct 2014, 21:47 3. Now that New Names has focus hit F2
Is there any way to remap the shortcut to a different key?
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post by rednoah »

No, but for reoccurring tasks I recommend making a Preset. Presets can be called via the number keys or numpad keys.
:idea: Please read the FAQ and How to Request Help.
SHJordan
Posts: 13
Joined: 05 May 2015, 11:03

Re: Fetch Artwork and Nfo for TV Shows

Post by SHJordan »

rednoah wrote: 06 Jan 2012, 11:46 Description:
  1. Download artwork for all your TV Shows from TheTVDB. Fetch tvshow nfo, series and season artwork and save files according to XBMC standards.
  2. Disable confirmation dialogs via -non-strict option (on headless machines this is the default).
Usage:

Code: Select all

filebot -script fn:artwork.tvdb /path/to/tvshows/
Options:
--q name to force search query manually instead of auto-detection
--conflict override to fetch artwork from scratch and not just missing artwork
-non-strict to disable user-interaction and run headless

Notes:
  • Episodes are expected to be organized into Show/Season N/Episode XY structure. The TV Show will be auto-detected from files and the folder structure.
i'm trying to write a drag'n'drop bat file for some shows that need to get names with spaces such as "Pop Team Epic"

which regularly would only get TEAM... but i'm failing to get the dragged folder PATH.

Here is what i got so far:

Code: Select all

for %%a in (.) do set currentfolder=%%~na
echo %currentfolder%
filebot -script fn:artwork.tvdb %1 --q '%currentfolder%' 
timeout /t -1
Can you take a look? or give some tips?
kim
Power User
Posts: 1077
Joined: 15 May 2014, 16:17

Re: How about sharing your CLI scripts?

Post by kim »

It's not clear what the problem is and you need to give a sample (with full file path) to test with ;)

?

Code: Select all

for %%a in (%1) do echo %%~nxa
for %%a in (%1) do echo %%~na
darkvinill
Posts: 15
Joined: 23 Feb 2018, 23:35

Re: Fetch subtitles for all files

Post by darkvinill »

rednoah wrote: 02 Apr 2014, 10:30 Description:
If you want to download subtitles for more than just a single folder then -get-subtitles -r in one batch with many many files can be a bad bad idea. This script will fetch subtitles folder per folder to make fetching large amounts of subtitles more reliable. Files may be included or excluded based on file creation date, last modified date, file size, video length, embedded subtitles, etc

:!: If you call this script repeatedly on the same folders or files then you MUST SET --def maxAgeDays to 30 days or less and call it no more than once per day.

Fetch subtitles for all files that have recently been created:

Code: Select all

filebot -script fn:suball /path/to/media -non-strict --def maxAgeDays=7
Fetch subtitles for all files:
You must not lookup subtitles for all files repeatedly in any kind of automated setup, or you will get banned. If you use the suball script in an automated setup then you MUST SET --def maxAgeDays to 30 days or less.

Code: Select all

filebot -script fn:suball /path/to/media

Files will be ignored and excluded from processing if one of the following conditions holds true:
  • file path matches your --def ignore pattern
  • time passed since file last-modified date is more than --def maxAgeDays
  • time passed since file last-modified date is less than --def minAgeDays
  • file size is less than --def minFileSize
  • video duration is less than --def minLengthMS
  • video file already contains embedded subtitles in a language matching your --def ignoreTextLanguage pattern (by default, if files contain subtitles of any language, no additional subtitles will be downloaded)
Options:
--lang zho set preferred subtitle language (default: eng)
--def maxAgeDays=7 set a max-age for files that will be processed, older files will be ignored
--def minAgeDays=1 set a min-age for files that will be processed, newer files will be ignored (so better subtitles can be downloaded later)
--def minFileSize=0 set a minimum file size, smaller files will be ignored (default: 50 MB)
--def minLengthMS=0 set a minimum video duration, shorter videos will be ignored (default: 10 min)
--def ignore=regex set an ignore pattern for paths that should be ignored
--def ignoreTextLanguage=regex set an ignore pattern for video files that already contain embedded subtitles in certain languages (default: .+)

Ho is this script different from the one that comes with filebot ?
User avatar
rednoah
The Source
Posts: 19365
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

The suball script gives you lots of extra options. It's built on top of simple -get-subtitles calls, by selecting files and making calls as necessary to make processing large batches of files more manageable.
:idea: Please read the FAQ and How to Request Help.
crisavec
Posts: 1
Joined: 16 Mar 2018, 01:37

Re: FileBot for Windows 7 and Windows Server

Post by crisavec »

Hello,
I have in the past contributed atleast 2 donations for filebot, and was wondering how to go about gaining access to the private builds. I am currently still running win7, with no plans to move to win10 until cannon lake desktop chips are stable.
Post Reply