Depends how you set it up. By default you will have local drive letters and also the pooled drive letter.
In windows you can mount a drive without a drive letter. In this case you mount it under another directory which is similar to a symlink. You would then just point DrivePool to this directory mount point if you don’t want the drive letters. It’s happy working either way. Same goes for SnapRAID. It to can work without drive letters.
@“Rich Hibbert” said:
Just wanted to say a big thank you Cayars for your script - beers on me if you’re ever down Hampshire way in the UK. I’m not completely incompetent with Powershell but Python is well out of my league!
I’m using it with another mishmash of borrowed and edited code to get utorrent working correctly with both rar’d and flat files - wish I could credit the original owners but I’m now not sure where I got the code from, I’ve been through that many pages looking for inspiration.
Pasting it here if it’s of use to anyone. utorrent uses the ‘run program’ functionality to call this as a batch file:
set fromdir=%1
set name=%2
set label=%3
set kind=%4
set filename=%5
set todir=z: orrents\extracted\
if %kind%=="single" goto copyfile
if exist %fromdir%\*.rar goto extractrar
if exist %fromdir%\*.mkv goto copyfile
if exist %fromdir%\*.avi goto copyfile
if exist %fromdir%\*.mp4 goto copyfile
GOTO:EOF
:copyfile
xcopy %fromdir%\*.mkv %todir% /S /I /Y
xcopy %fromdir%\*.mp4 %todir% /S /I /Y
xcopy %fromdir%\*.avi %todir% /S /I /Y
GOTO runtranscode
:extractrar
echo Extracts all rars in %fromdir% to %todir%.
rem Requires WinRar installed to c:\Program files
if not exist %todir% mkdir %todir%
"c:\program files\winrar\winrar.exe" x -ibck -inul %fromdir%\*.rar *.* %todir%
GOTO runtranscode
:runtranscode
cd\
c:
cd convert
c:\python27\python manual.py -a -i Z: orrents\extracted
GOTO:EOF
So:
uTorrent pulls the file.
Script moves it if it’s an mkv, avi or mp4 to the ‘extracted’ folder. If it’s a .rar, winrar takes over and extracts to the same folder.
Cayars script then runs against the ‘extracted’ folder and outputs to the ‘converted’ folder.
Sonarr then pulls the final file in to the relevant library location.
Thanks for the usefull info. But what happen If we have also TV and movies at the same time downloading?,
How will be the definition for both folders into the same script>.
HI @cayars I know your Script will but in this case using it in combination with the Utorrent script is the question.
SR label the file with TV and Utorrent added to the TV folder
CP label the file with movies and added to another folder
so the issue it’s to define where to look at and then when it finish optimising the file with your scripts, where to locate back the file depending on the labels .
when im trying to use the Converter i run the run.bat i get the cmd prompt opens and closes right away
when i do it manually i get
c:\Python27>python manual.py -a -i c:\convert\process
python: can’t open file ‘manual.py’: [Errno 2] No such file or directory
i just installed a fresh pythin27
not sure what happen it used to work the only thing i did was copy and replaced the old convert with the beta
@TwistedEndz said:
when im trying to use the Converter i run the run.bat i get the cmd prompt opens and closes right away
when i do it manually i get
c:\Python27>python manual.py -a -i c:\convert\process
python: can’t open file ‘manual.py’: [Errno 2] No such file or directory
i just installed a fresh pythin27
not sure what happen it used to work the only thing i did was copy and replaced the old convert with the beta
put the full path to the manual.py. if you are not in the convert directory when calling manual.py or the directory is not part of the environement paths, you will get that message
@TwistedEndz said:
the manual.py is in the convert dir not python for some reason , not sure at all why this all worked the first time . . ill try
python can be used without putting the full path because C:\python27 is in the environment values . manual.py is in convert dir so it should be python c:\convert\manual.py -a -i c:\convert\process
If you switched from the old version to the new version currently called “beta” then you need to do more than just drop in the zip file. You will find a instructions.txt file which has the directions:
open powershell and cut and paste the following:
cd c:\python27
pip install requests
pip install requests[security]
pip install requests-cache
pip install babelfish
pip install “guessit<2”
pip install “subliminal<2”
pip install stevedore==1.19.1
pip install python-dateutil
pip install deluge-client
pip install qtfaststart
exit or close powershell
As with previous script modify run.bat to match your directories if needed. At present it will look in c:\convert\process for files that need to be processed.
In a nutshell this version requires additional libraries to be installed and some of them must be recent versions. On windows you can cut and paste the pip installs to get things working quickly. Once you have the new version working and when I release a new version you will be able to just drop that in since you will have the python libs installed.
Speaking of which I’ll probably be updating this in the next day or two with a minor update and will call it Convert2.x instead of beta. I’ll rename the older one to version 1 and keep it out there for those who need it.
If I wanted to convert all Movies that are not optimized for streamingand (and the alternative: or) do not have a default audio language set as english, how would I modify the following:
.open 'C:\Users\Jason\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db'
.output "3_No_Default_Or_English_Audio_Files.bat"
SELECT 'c:\python27\Python C:\convert\manual.py -a -i "' || mp.file || '"' FROM media_parts as mp inner join media_items as mi
on mi.id = mp.media_item_id inner join metadata_items as mdi
on mdi.id = mi.metadata_item_id where mp.id not in (SELECT media_part_id from media_streams where stream_type_id = 2 and language = "eng") and mdi.metadata_type < 5
order by mp.file;
I believe I’ve already provided the scripts for both of those. Instead of trying to combine them into one statement just run them as the two distinct scripts. If a movies falls into both categories it will get fixed during the first script you run so combining them doesn’t gain you anything.
@cayars said:
I believe I’ve already provided the scripts for both of those. Instead of trying to combine them into one statement just run them as the two distinct scripts. If a movies falls into both categories it will get fixed during the first script you run so combining them doesn’t gain you anything.
Carlo
Whew… I found the answers (and favorited the post BTW…).
Having no knowledge of the sqlite interrogatory, is there a way to filter the output further to only select/include Movies from the database as opposed to TV, Audiobooks, etc?
@cayars said:
Yes, you just need to filter by library number. If you can’t figure it out or don’t want to just say the word and I’ll do it for you.
Argh… Now your toying with me…
on library_sections.movies=movies
Then how to integrate that WITH the previous selection? In adding that to the select non-mp4 files script I know that what I have is wrong, since the file selection does not even reference the library type
.open 'C:\Users\Jason\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db'
.output 1_Non_MP4.bat
SELECT 'c:\python27\Python C:\convert\manual.py -a -i "' || file || '"' FROM media_parts join media_items
on library_sections.movies=movies
on media_parts.media_item_id=media_items.id
where container!='mp4'
order by file;
.open ‘C:\Users\Jason\AppData\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db’
.output 1_Non_MP4.bat
SELECT ‘c:\python27\Python C:\convert\manual.py -a -i "’ || file || ‘"’ FROM media_parts join media_items
on library_sections.movies=movies
on media_parts.media_item_id=media_items.id
where container!=‘mp4’ where media_items.library_section_id=11
order by file;
where media_items.library_section_id=11 is what is new.
You will need to change the 11 to match the library number you want to use. You can get this from the URL in a web browser.
For example if I view my MOVIES library on my system there will be a section of the URL that has this in it:
key=%2Flibrary%2Fsections%2F11
The number at the end is what you want to use.
You could look this up in another table where it’s stored but this is the down and dirty/easy way to do what you want.