Notification of Extraction Error
Notification of Extraction Error
Possible to add a function to notify on successful and unsuccessful operation. Currently only will notify if something is successfully copied/renamed whatever or extracted and copied then renamed. I would like to know if it fails so i can go in and manually fix it. This would help a lot.
Re: Notification of Extraction Error
If you pass in an archive and extraction fails, then there'll be no input files and the script will exit unsuccessfully. It won't send notification emails though because "nothing to do" is somewhat normal for people who run the script on a schedule every few hours.
You can write your own shell script and send out some notification depending on the amc script exit value.
You can write your own shell script and send out some notification depending on the amc script exit value.
Re: Notification of Extraction Error
I also think that notification of an error state would be useful, perhaps using the same mechanism as set up for successful output (here I am using pushbullet). I personally run the script on-demand, triggered by Transmission, and think it would be useful to be notified of errors in an otherwise set-it-and-forget-it type environment.
Here's an example error that it would be good to receive.
Here's an example error that it would be good to receive.
Code: Select all
Run script [fn:amc] at [Thu Jan 05 21:00:31 EST 2017]
Parameter: clean = y
Parameter: artwork = n
Parameter: ut_dir = /home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION
Parameter: ut_kind = multi
Parameter: ut_title = The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION
Parameter: seriesFormat = /storage/TV/{n}/{'S'+s.pad(2)}/{n.replaceAll(/[!?.]+$/).space('.')}.{'s'+s.pad(2)}e{e.pad(2)}.{vf}.{source}.{vc}.{ac}
Parameter: movieFormat = /storage/Movies/{n.upperInitial().replaceAll(/[!?.]+$/).space('.')}.{y}.{vf}.{source}.{vc}.{ac}
Parameter: pushbullet = *****
Parameter: reportError = y
Ignore extra: /home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/Sample
Read archive [hawkings.kids.1012.1080-dimension.rar] and extract to [/home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/hawkings.kids.1012.1080-dimension/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION]
Extracting files [/home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/hawkings.kids.1012.1080-dimension/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION.mkv]
Input: /home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/hawkings.kids.1012.1080-dimension/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION.mkv
Group: [tvs:the big bang theory] => [The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION.mkv]
Jan 05, 2017 9:00:36 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
Jan 05, 2017 9:00:36 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
Rename episodes using [TheTVDB]
Auto-detected query: [The Big Bang Theory]
<?xml version="1.0" encoding="UTF-8" ?>
Could not connect: Too many connections
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at net.filebot.web.WebRequest.validateXml(WebRequest.java:324)
at net.filebot.CachedResource.lambda$validateXml$5(CachedResource.java:169)
at net.filebot.CachedResource.lambda$get$1(CachedResource.java:99)
at net.filebot.Cache.computeIf(Cache.java:90)
at net.filebot.CachedResource.get(CachedResource.java:82)
at net.filebot.web.TheTVDBClientV1.getXmlResource(TheTVDBClientV1.java:272)
at net.filebot.web.TheTVDBClientV1.fetchSearchResult(TheTVDBClientV1.java:91)
at net.filebot.WebServices$TheTVDBClientWithLocalSearch.access$001(WebServices.java:128)
at net.filebot.WebServices$TheTVDBClientWithLocalSearch.lambda$fetchSearchResult$4(WebServices.java:150)
Fetch failed: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; Content is not allowed in prolog. [http://thetvdb.com/api/GetSeries.php?seriesname=The+Big+Bang+Theory&language=en]
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; Content is not allowed in prolog.
Clean temporary extracted files
Delete /home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/hawkings.kids.1012.1080-dimension/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION.mkv
Delete /home/frank/TransmissionDL/The.Big.Bang.Theory.S10E12.1080p.HDTV.X264-DIMENSION/hawkings.kids.1012.1080-dimension
Finished without processing any files
Failure (°_°)
Re: Notification of Extraction Error
In this case you will get a non-zero exit code from FileBot and you can do your own error handling (e.g. sending the last x lines from the log file to your pushbullet account).
@see https://danielgibbs.co.uk/2016/06/send- ... from-bash/
Unfortunately, the amc script itself doesn't know the std/err output because FileBot does not store that in memory. It can only send Finished without processing any files which would be fairly useless.
@see https://danielgibbs.co.uk/2016/06/send- ... from-bash/
Unfortunately, the amc script itself doesn't know the std/err output because FileBot does not store that in memory. It can only send Finished without processing any files which would be fairly useless.