java.nio.file.FileSystemException
Posted: 28 Aug 2017, 03:45
Sysinfo (Windows Store):
Using qBittorrent v3.3.15 x64 to run script upon download completion:
I regularly get failures that look like this:
Any way to avoid them?
Code: Select all
FileBot 4.7.12 (r5171)
JNA Native: 5.1.0
MediaInfo: 0.7.93
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-05-15 (r500)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_141
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 3 GB Max Memory / 39 MB Used Memory
OS: Windows 10 (amd64)
Package: APPX
Done ?(?????)?
Code: Select all
"D:\utorrent-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
Code: Select all
# Run Program:
# "C:\path\to\utorrent-postprocess.pyw" "%L" "%S" "%N" "%K" "%F" "%D"
#
# Test with Console:
# python "C:\path\to\utorrent-postprocess.pyw" "Movie" "5" "Avatar" "multi" "" "X:\Files\Avatar"
import sys
import subprocess
# configuration
output = 'D:/'
# custom formats (use / instead of \ as directory separator)
movieFormat = "D:/_Movies/{n} ({y})/{fn}"
seriesFormat = "D:/_TV Shows/{n}/{'Season '+s}/{fn}"
animeFormat = '''{plex}'''
musicFormat = '''{plex}'''
# required args
label, state, title, kind, file, directory = sys.argv[1:7]
command = [
'filebot', '-script', 'fn:amc',
'--output', output,
'--action', 'move',
'--conflict', 'override',
'-non-strict',
'--log-file', output + 'amc.log',
'--def',
'unsorted=y',
'music=n',
'artwork=n',
'movieFormat=' + movieFormat,
'seriesFormat=' + seriesFormat,
'animeFormat=' + animeFormat,
'musicFormat=' + musicFormat,
'ut_label=' + label,
'ut_state=' + state,
'ut_title=' + title,
'ut_kind=' + kind,
'ut_file=' + file,
'ut_dir=' + directory
]
# execute command only for certain conditions (disabled by default)
'''
if state not in ['5', '11']:
print('Illegal state: %s' % state)
sys.exit(0)
'''
# execute command (and hide cmd window)
subprocess.run(command, creationflags=0x08000000)
I regularly get failures that look like this:
Code: Select all
[MOVE] Failure: java.nio.file.FileSystemException: D:\_qBittorrent\The.Last.Ship.S04E03.720p.HDTV.X264-DIMENSION[rarbg]\The.Last.Ship.S04E03.720p.HDTV.X264-DIMENSION.mkv -> D:\_TV Shows\The Last Ship\Season 4\The.Last.Ship.S04E03.720p.HDTV.X264-DIMENSION.mkv: The process cannot access the file because it is being used by another process.