Commit graph

614 commits

Author SHA1 Message Date
clinton-hall
bfaf2ddb17 Merge branch 'nightly' of https://github.com/clinton-hall/nzbToMedia into nightly 2016-10-07 22:48:30 +10:30
clinton-hall
07f419640c catch errors if not audio codec name. Fixes #1109 2016-10-07 22:47:01 +10:30
Marvin Pinto
2c8b2fc8cf Typecast the 'bit_rate' and 'channels' values into floats before attempting to convert them to ints
Otherwise we end up in a situation where audio3[0].get("bit_rate", 0)
returns the string `"192000.000000"`, which cannot be converted into an
int.

Example:

```
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> int("192000.000000")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '192000.000000'
>>> int(float("192000.000000"))
192000
```

Relevant log entry:
```
[10:50:57] [DEBUG]::TRANSCODER: ******* Specified bit rate is: 192000.000000
Traceback (most recent call last):
  File "/opt/nzbtomedia/nzbToSickBeard.py", line 254, in <module>
    result = nzbToMedia.main(sys.argv, section)
  File "/opt/nzbtomedia/nzbToMedia.py", line 726, in main
    download_id='')
  File "/opt/nzbtomedia/nzbToMedia.py", line 615, in process
    download_id, inputCategory, failureLink)
  File "/opt/nzbtomedia/core/autoProcess/autoProcessTV.py", line 162, in processEpisode
    result, newDirName = transcoder.Transcode_directory(dirName)
  File "/opt/nzbtomedia/core/transcoder/transcoder.py", line 708, in Transcode_directory
    command = buildCommands(file, newDir, movieName, bitbucket)
  File "/opt/nzbtomedia/core/transcoder/transcoder.py", line 278, in buildCommands
    bitrate = int(audio1[0].get("bit_rate", 0)) / 1000
ValueError: invalid literal for int() with base 10: '192000.000000'
Exception TypeError: "'NoneType' object is not callable" in <bound method PosixProcess.__del__ of <core.nzbToMediaUtil.PosixProcess object at 0x7ffa6a37e590>> ignored
```
2016-10-03 16:00:37 -04:00
Marvin Pinto
cb0de3ca98 Add the ability to set octal permissions on the processed files prior to handing it off to Sickrage/Couchpotato
If set, the `chmodDirectory` option instructs the nzbToMedia
post-processing script to set the recursive directory permissions to the
octal value specified.
2016-10-03 16:00:33 -04:00
clinton-hall
14be873c7c fix another int(Section) error. 2016-09-29 07:02:28 +09:30
clinton-hall
879584c107 allow guessit to work of full file path 2016-09-22 09:28:27 +09:30
clinton-hall
d692acb061 fix guessit call. Fixes #1105 2016-09-22 07:11:58 +09:30
Clinton Hall
c9d71945c4 Merge pull request #1100 from fernandog/add_medusa
Add Medusa fork and new param "ignore_subs"
2016-09-21 22:12:25 +09:30
clinton-hall
0625f7f3c0 updated libs to fix guessit and subliminal. Fixes #1080 2016-09-21 13:31:41 +09:30
clinton-hall
319d418af8 convert to 3 letter language code. Fixes #1088 2016-09-21 11:12:42 +09:30
clinton-hall
e5a46f581d added check for language tag size. Fixes #1087 2016-09-21 09:42:32 +09:30
Billie Thompson
adcc061a67 Update autoProcessTV.py
There is a minor typo in the user messages. This will resolve it.
2016-09-18 11:50:19 +01:00
Fernando
613ddb129a Add Medusa fork and new param "ignore_subs" 2016-09-05 15:58:12 -03:00
Labrys of Knossos
0ce7582da5 Merge pull request #1050 from clinton-hall/code-cleanup-3
Code cleanup 3
2016-06-12 03:42:18 -04:00
clinton-hall
ef8701ed59 fix autofork detection. Fixes #1056 2016-06-08 22:22:07 +09:30
Labrys
1085c5851c Apply dict type-casting in autoFork too.
* Fixes #1056
2016-06-07 08:53:36 -04:00
labrys
c5b60adb33 Fix spelling 2016-06-06 09:08:32 -04:00
labrys
2ad9f2e35f Standardize string formatting to use .format instead of concat 2016-06-06 09:08:24 -04:00
clinton-hall
f093fafd8d move import of six after addition of path. 2016-06-06 21:29:50 +09:30
Labrys
df8c6bc20f Too broad exceptions.
* Use .get() with default value instead.
2016-06-05 13:35:46 -04:00
Labrys
1cd073cd52 Use format() instead of % for string formatting 2016-06-05 12:54:24 -04:00
Labrys
94e8a45c62 Code cleanup
* Streamline variable assignment
* Replace assignment with augmented assignment
* Remove unused variables and redundant parentheses
2016-06-05 12:54:23 -04:00
Labrys
47c585d81c Rewrite dictionary creation as a dictionary literal 2016-06-05 12:54:22 -04:00
Labrys
a983c6c7be Streamline conditional statements
* Non-zero ints evaluate True.
2016-06-05 12:54:20 -04:00
Labrys
eb1ee8b5f5 Set expected, but passing list 2016-06-05 12:54:05 -04:00
Labrys
22daf02167 Python 3: Raise with no arguments can only be used in an except block 2016-06-05 12:54:05 -04:00
Labrys
76a00b2493 Convert to new-style class by inheriting from object 2016-06-05 12:54:04 -04:00
Labrys
8434fd5419 Python 3: Fix relative imports 2016-06-05 12:54:03 -04:00
Labrys
ec71e7806d Python 3: Convert except ExceptClass, Target: to except ExceptClass as Target: 2016-06-05 12:54:02 -04:00
Labrys
5903538ae5 Python 3: Make long = int 2016-06-05 12:50:35 -04:00
Labrys
ec2fc8d538 Use six.text_type
* Standarizes unicode function between Python 2 and Python 3
2016-06-05 12:15:05 -04:00
Labrys
abf63d6bbe Use six.iteritems helper
* Standardizes dict.iteritems between Python 2 and Python 3
2016-06-05 12:14:04 -04:00
Labrys
d4e5809a29 Use print_function to standardize printing between Python 2 and Python 3 2016-06-05 12:09:39 -04:00
Labrys
cf1ae938fc Use six to standardize imports between Python 2 and Python 3 2016-06-05 12:09:09 -04:00
Labrys
382d108db2 Optimize imports
* PEP8: Fix module level import not at top of file
* Remove unused imports
* Remove simplejson
* Replace mimetools with email
2016-06-05 12:03:16 -04:00
Labrys
3acaf29f1e Update six to 1.10.0 2016-06-05 12:00:21 -04:00
Labrys
1fd904eb5b PEP8: Tests for membership should use in/not in
* .has_key() is deprecated, use `in`
2016-06-05 12:00:20 -04:00
Labrys
92ae852513 PEP8: comparison to None, True, or False should use is/is not 2016-06-05 12:00:20 -04:00
Labrys
8cd0e76ef8 PEP8: Fix formatting
* Remove redundant backslash between brackets
* Fix multiple statements on one line
* Fix missing/excess whitespace
* Fix comments not starting with a single # and a space
* Convert tabs to spaces
* Use triple-quoted docstring
2016-06-05 11:59:58 -04:00
Labrys
81ffe0456d Add encoding declaration 2016-06-05 02:01:03 -04:00
Labrys
a4fd80e695 Fix TypeError for missing keys by type-casting config to dict 2016-06-05 01:45:04 -04:00
Labrys
b4541d3236 Fix config option extract never being used 2016-06-05 01:40:13 -04:00
Labrys
51d2c73054 Use format() instead of % for string formatting 2016-05-31 12:02:40 -04:00
labrys
0c45961382 Streamline variable assignment 2016-05-31 12:00:45 -04:00
labrys
88c9d74206 Fix log message:
* Renamed url1 to url
* Added `section` argument to CDH
* Removed undefined variable `good_files`
2016-05-31 12:00:42 -04:00
labrys
8880d11e8a Too broad exceptions.
* Use .get() with default value instead.
* Use ValueError to catch JSONDecodeError from simplejson and ValueError from json standard lib
* Use request.RequestException instead.
2016-05-31 12:00:41 -04:00
labrys
8235134fad Rewrite dictionary creation as a dictionary literal 2016-05-31 12:00:38 -04:00
labrys
4a4087180b Python 3: Convert 'except exceptClass, Target' to 'except exceptClass as Target' 2016-05-31 12:00:36 -04:00
labrys
03fa8bc973 Replace assignment with augmented assignment 2016-05-31 12:00:34 -04:00
labrys
c5c5279a8b PEP8: .has_key() is deprecated, use 'in' 2016-05-31 12:00:30 -04:00