Scripting Help Needed

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
marioncobretti
Posts: 6
Joined: 20 Oct 2013, 12:27

Scripting Help Needed

Post by marioncobretti »

Hi i need to write a script and i am completely lost

here is the situation i am in

For first time viewing i download basic low res releases.Some of them has mkv ext. some of them has mp4.All files downloads to a temp folder to be processed later.

Overnight i download high res (mostly 1080p) web dl releases to the same temp folder for.This is for archiving.And note that this release will be downloaded after the low res releases.

Sidenote
I use xbmc to watch and use metadata and if i am honest honest its prettier to look at.

And the archiving system is basic

Media

Series (has subfolders named after series name using tvdb)
Movies (has subfolders named after movies name and year)
Animes (Same as series)
Cat Videos

I will catogorize the temp folder to specific folders too (just like the media folder above) if i can get the script working.

Lets get to the problem
I use gui most of the time since i am a complete stranger to coding.So if i understand correctly i must write 3 or 4 scripts to get this working.

Lets Start with an example

First downloaded file - (mp4 - res 404x720)

how.i.met.your.mother.s09e10.hdtv.x264.killers.mp4

it will be renamed to

How I Met Your Mother - S09E10 - Mom and Dad.mp4
and moved the matching folder in archiving (D:/Media/Series/How I Met Your Mother)

Late Release - Web DL (MKV - 1080x1920)

how.i.met.your.mother.s09e10.1080p.web.dl.dd5.1.mkv

it will be renamed to

How I Met Your Mother - S09E10 - Mom and Dad.mkv
and moved the same archiving folder (D:/Media/Series/How I Met Your Mother)

Now in the same folder (since the extensions are diffirent there is no overwriting)
there is


How I Met Your Mother - S09E10 - Mom and Dad.mp4
How I Met Your Mother - S09E10 - Mom and Dad.mkv

and even with the same extension (overwritng possible) i cant move the file in gui.
So

Problem #1
Overwriting and keeping single/best copy of the media.(note that the best release probably will be downloaded latest and the file extensions can be diffirent)

Lets move on

Problem #2
I never used scripts so some one must enlighten me.When renaming using gui i can choose the show so will there be any windows popping to asking me.This may cause a problem in animes.

Final Structure will be

For Temp Download Folder

Temp

Animes
Series
Movies
Music
Cat Videos.

Media Folder will have the same structure before

Media

Series (has subfolders named after series name using tvdb)
Movies (has subfolders named after movies name and year)
Animes (Same as series)
Cat Videos

So each script will look for files in specific folder and move them to specific folders (like Anime>>Anime)

You must understand that i dont know how to write scripts at all

If someone can help me please I am at complete lost here.
User avatar
rednoah
The Source
Posts: 23133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help Needed

Post by rednoah »

So by your last sentence I'm guessing you either want to learn Groovy programming, or you're trying hiring someone to do all the work for you? :?:

This sounds like quite a bit of work, highly specific to your setup, so unless you're willing to bid me >200€ for this task I probably won't have time looking into this. :ugeek:
:idea: Please read the FAQ and How to Request Help.
marioncobretti
Posts: 6
Joined: 20 Oct 2013, 12:27

Re: Scripting Help Needed

Post by marioncobretti »

ok i need to clarifiy few things

I know you write this beatiful piece of code.Beleive me its my legs and arms when it comes to putting my media in shape.but there is not a guide or "filebot scripting for dummies" book any where.There is bits and pieces but not a complete guide to write script exactly what i want.And try to understand that i have a so little time in my hands i have to use it efficiently.You can sympathize.I reaaly dont have time to learn coding like you dont have to learn about laws of thermodynamics (there is 3 of them and really basic to understand but hard to use in real life.Ok may be first one is easy but the other 2 are nightmares)

I know that getting the coder impatient and/or angry is not the way to go when the software is free since you can just gave up but I mean this thing should be right in the soource already.i have to write a script just to move my animes to the right folder?

And now i have to pay you 200 euros to write a batch file that will probably take 2 minutes to write.

For godsakes man 200 euros.Thats half of my paycheck.(i live in turkey) can you accept payment in installments.

Here what are my thoughts about what i asked before

1-specific scripts should actually easiest one to do.Normally using gui i set the renaming using parameters like which folder will it go and subfolder namig.
This is for animes.When i try to rename animes using anidb it moves the renamed files to the folder i use for tv shows.Since you wrote the code you should know how to tweak this.Basicly Anime script will rename the file on the anime temp folder move it to the anime archive folder not to tv series archive folder.Isnt moving part and the subfolder thing can be tweaked using scripts or do i have to deep deeper?
I have the exact same problem with xbmc.Xbmc sees my animes as tv shows so i had to use playlists which is a pain in the a**.

2-Overwriting (replacing the file with the new downloaded one. same file extension (mkv-mkv or mp4-mp4) is basicly a command i beleive.i can be wrong.as i said im not a coder.You are.

3-The hardest one would be actually looking for a file have the exact file name but diffirent (mkv-mp4) extension and delete the mp4 one it.This is not a deal killer i can probably tweak duplicate file finder to find these suckers.But doing that automaticly would be great.if this things goes into checking videos codecs and others staff that can be complicated.More complicated more bugs more problems.

I have to write in details to get things right.sorry for the long post.
User avatar
rednoah
The Source
Posts: 23133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Scripting Help Needed

Post by rednoah »

You're always welcome to reuse tweak any of my existing scripts, for free.

1.
You just need to call -rename on the folder no?

Code: Select all

filebot -rename -r --db anidb /anime-folder
So you don't actually need auto-categorization. Plenty of examples online.

FileBot = Groovy script + extra functions, so you only need to learn a bit of Groovy for which there sure are a quad-zillion tutorials online. And to make small modifications you can probably just do copy/paste/modify-slightly.

Like in the AMC script there's forceAnime/forceSeries/forceMovie functions which you can augment with your folder rules. If you were to use the AMC script.

2.
The duplicate-ignore-ext detection wouldn't be that hard. I'd use a custom rename function in AMC, though it's probably easier to write a standalone script to find duplicates and keep the newer one (and or higher resolution one). Many options here, not that hard, depending on how you do it.



The point of asking for money isn't making money, it's not spending time on individual cases that have little to no benefit to the general user base. Simply not worth my time, unless you make it so. It's not personal, nobody ever goes for it. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply