morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.87k stars 223 forks source link

Syncing with Sonarr fails often #73

Closed faulander closed 6 years ago

faulander commented 6 years ago

Hi, now i got a stacktrace for you with my Sonarr Syncing Problem:

Job "Sync episodes with Sonarr (trigger: interval[0:05:00], next run at: 2018-05-31 06:53:14 CEST)" raised an exception

'Traceback (most recent call last):\n File "/usr/lib/python2.7/site-packages/apscheduler/executors/base.py", line 125, in run_job\n retval = job.func(*job.args, **job.kwargs)\n File "/bazarr/get_episodes.py", line 35, in sync_episodes\n if episode[\'hasFile\'] and episode[\'episodeFile\'][\'size\'] > 20480:\nTypeError: string indices must be integers'

morpheus65535 commented 6 years ago

Can you send me the json returned by the Sonarr API:

http://sonarr_server/api/episode?seriesId=1&apikey=12345678901234567890123456789012

Replace with your Sonarr API key and increase seriesId if 1 isn't a valid one.

Thanks!

faulander commented 6 years ago

[ { "seriesId": 4, "episodeFileId": 14, "seasonNumber": 1, "episodeNumber": 1, "title": "Chapter One: Make Your Mark", "airDate": "2018-03-25", "airDateUtc": "2018-03-26T02:30:00Z", "overview": "Barry is a disillusioned hitman from the Midwest. His handler, Fuches, sends him to LA to execute a hit for the Chechen mob, led by Goran Pazar and his right-hand man, NoHo Hank. Barry’s target: an aspiring actor who is having an affair with Pazar’s wife. Barry follows his “mark” into an acting class taught by beloved teacher/guru Gene Cousineau, and is instantly drawn to the group of students, especially Sally. Barry wants to start a new life in the class, but the criminal world won’t let him walk away so easily.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry - 1x01 - Chapter One Make Your Mark.mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry - 1x01 - Chapter One Make Your Mark.mkv", "size": 594740561, "dateAdded": "2018-05-04T16:05:40.551636Z", "quality": { "quality": { "id": 4, "name": "HDTV-720p", "source": "television", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": false, "id": 14 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 1, "unverifiedSceneNumbering": false, "id": 21 }, { "seriesId": 4, "episodeFileId": 15, "seasonNumber": 1, "episodeNumber": 2, "title": "Chapter Two: Use It", "airDate": "2018-04-01", "airDateUtc": "2018-04-02T02:30:00Z", "overview": "In the wake of shocking news, Gene encourages his students to channel their feelings into their work. Resolved to quit his job and put the past behind him, Barry tries not to get pulled back in by Fuches and the Chechens. Sally tries to crack the nut that is Barry.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E02.720p.WEB.H264-DEFLATE[eztv].mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E02.720p.WEB.H264-DEFLATE[eztv].mkv", "size": 542340229, "dateAdded": "2018-05-04T16:05:40.741966Z", "quality": { "quality": { "id": 5, "name": "WEBDL-720p", "source": "web", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": true, "id": 15 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 2, "unverifiedSceneNumbering": false, "id": 22 }, { "seriesId": 4, "episodeFileId": 16, "seasonNumber": 1, "episodeNumber": 3, "title": "Chapter Three: Make the Unsafe Choice", "airDate": "2018-04-08", "airDateUtc": "2018-04-09T02:30:00Z", "overview": "A frustrated Barry misses an acting class to honor an obligation. Detectives Moss and Loach try to piece together a murder puzzle. Gene presses Barry to take more risks. Sally is thrown for a loop during an audition, and turns to Barry for comfort. The Chechens rejoice when a legendary assassin arrives.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E03.720p.WEB.H264-DEFLATE[rarbg].mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E03.720p.WEB.H264-DEFLATE[rarbg].mkv", "size": 653238876, "dateAdded": "2018-05-04T16:05:41.016368Z", "quality": { "quality": { "id": 5, "name": "WEBDL-720p", "source": "web", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": true, "id": 16 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 3, "unverifiedSceneNumbering": false, "id": 23 }, { "seriesId": 4, "episodeFileId": 17, "seasonNumber": 1, "episodeNumber": 4, "title": "Chapter Four: Commit to... YOU", "airDate": "2018-04-15", "airDateUtc": "2018-04-16T02:30:00Z", "overview": "Barry finds that distancing himself from Fuches and the Chechens might be harder than he thought. Sally is dismayed to learn that an audition arranged by a prospective agent has strings attached. Gene promises Moss a bombshell, but only over dinner. Barry invites a Marine buddy and his two pals to a party given by his classmate Natalie, where Zach, a rising actor, threatens Barry’s claim on Sally.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E04.Chapter.Four-.Commit.to.You.WEBDL-720p.DEFLATE.mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E04.Chapter.Four-.Commit.to.You.WEBDL-720p.DEFLATE.mkv", "size": 614454034, "dateAdded": "2018-05-04T16:05:41.169033Z", "quality": { "quality": { "id": 5, "name": "WEBDL-720p", "source": "web", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": true, "id": 17 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 4, "unverifiedSceneNumbering": false, "id": 24 }, { "seriesId": 4, "episodeFileId": 18, "seasonNumber": 1, "episodeNumber": 5, "title": "Chapter Five: Do Your Job", "airDate": "2018-04-22", "airDateUtc": "2018-04-23T02:30:00Z", "overview": "Barry looks to hit the reset button with Sally, but a scene from “Macbeth” triggers a reaction that pushes them farther apart. Moss moves to interrogate members of Gene’s acting class after a shooting video surfaces. Barry finds himself in a quandary after teaming up with Taylor, a reckless new acquaintance, in a dangerous mission to wipe out a group of Bolivians.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E05.Chapter.Five-.Do.Your.Job.WEBDL-720p.DEFLATE.mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E05.Chapter.Five-.Do.Your.Job.WEBDL-720p.DEFLATE.mkv", "size": 630248998, "dateAdded": "2018-05-04T16:05:41.315675Z", "quality": { "quality": { "id": 5, "name": "WEBDL-720p", "source": "web", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": true, "id": 18 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 5, "unverifiedSceneNumbering": false, "id": 25 }, { "seriesId": 4, "episodeFileId": 19, "seasonNumber": 1, "episodeNumber": 6, "title": "Chapter Six: Listen with Your Ears, React with Your Face", "airDate": "2018-04-29", "airDateUtc": "2018-04-30T02:30:00Z", "overview": "Barry tries to fly solo at a remote airstrip, but Taylor still wants in. Vacha looks to exact revenge on the man who killed his brother, despite Pazar’s hands-off orders. Moss tries to end her association with Gene, but finds herself drawn to his classroom at a critical juncture. Sally lobbies for a major acting challenge.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E06.Chapter.Six-.Listen.with.Your.Ears,.React.with.Your.Face.WEBDL-720p.DEFLATE.mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E06.Chapter.Six-.Listen.with.Your.Ears,.React.with.Your.Face.WEBDL-720p.DEFLATE.mkv", "size": 631497192, "dateAdded": "2018-05-04T16:05:41.474066Z", "quality": { "quality": { "id": 5, "name": "WEBDL-720p", "source": "web", "resolution": 720 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": true, "id": 19 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 6, "unverifiedSceneNumbering": false, "id": 26 }, { "seriesId": 4, "episodeFileId": 1256, "seasonNumber": 1, "episodeNumber": 7, "title": "Chapter Seven: Loud, Fast and Keep Going", "airDate": "2018-05-06", "airDateUtc": "2018-05-07T02:30:00Z", "overview": "After a deadly shootout at the airstrip, Barry must make a difficult decision to evade capture. Pazar blames Fuches for convincing him to declare war on Cristobal Sifuentes, a ruthless yet civilized Bolivian drug lord. Sally fears her performance in the class production of “Macbeth” will be compromised, ruining her chance to impress another top Hollywood agent.", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "01/Barry.S01E07.Chapter.Seven-.Loud,.Fast,.and.Keep.Going.WEBDL-1080p.DEFLATE.mkv", "path": "/mnt/HD/TV/Barry/01/Barry.S01E07.Chapter.Seven-.Loud,.Fast,.and.Keep.Going.WEBDL-1080p.DEFLATE.mkv", "size": 2046852628, "dateAdded": "2018-05-07T05:13:55.264988Z", "sceneName": "Barry.S01E07.1080p.WEB.H264-DEFLATE[rarbg]", "quality": { "quality": { "id": 3, "name": "WEBDL-1080p", "source": "web", "resolution": 1080 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": false, "id": 1256 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 7, "unverifiedSceneNumbering": false, "id": 27 }, { "seriesId": 4, "episodeFileId": 1340, "seasonNumber": 1, "episodeNumber": 8, "title": "Chapter Eight: Know Your Truth", "airDate": "2018-05-13", "airDateUtc": "2018-05-14T02:30:00Z", "overview": "Barry vows to give up his life of crime, once and for all. Pazar enlists Vacha's replacement to take care of Fuches. Moss and her team close in on a major arrest with hopes of finally cracking the Madison case.\nSeason Finale", "episodeFile": { "seriesId": 4, "seasonNumber": 1, "relativePath": "Season 1/Barry.S01E08.Chapter.Eight-.Know.Your.Truth.WEBDL-1080p.DEFLATE.mkv", "path": "/mnt/HD/TV/Barry/Season 1/Barry.S01E08.Chapter.Eight-.Know.Your.Truth.WEBDL-1080p.DEFLATE.mkv", "size": 2467272137, "dateAdded": "2018-05-14T05:32:36.467107Z", "sceneName": "Barry.S01E08.1080p.WEB.H264-DEFLATE[rarbg]", "quality": { "quality": { "id": 3, "name": "WEBDL-1080p", "source": "web", "resolution": 1080 }, "revision": { "version": 1, "real": 0 } }, "mediaInfo": { "audioChannels": 5.1, "audioCodec": "EAC3", "videoCodec": "h264" }, "qualityCutoffNotMet": false, "id": 1340 }, "hasFile": true, "monitored": true, "absoluteEpisodeNumber": 8, "unverifiedSceneNumbering": false, "id": 28 } ]

faulander commented 6 years ago

couldn't you just do: if episode['hasFile'] and long(episode['episodeFile']['size']) > 20480: instead of: if episode['hasFile'] and episode['episodeFile']['size'] > 20480: ?

morpheus65535 commented 6 years ago

You probably got one of your series that include an episode with "hasFile" = True but no episodeFile sub-key. I'm going to add a check for that. BTW, Another run into the same thing yesterday but for Radarr movies.

faulander commented 6 years ago

Still get the same problem after the latest update: 'Traceback (most recent call last):\n File "/usr/lib/python2.7/site-packages/apscheduler/executors/base.py", line 125, in run_job\n retval = job.func(*job.args, **job.kwargs)\n File "/bazarr/get_episodes.py", line 41, in sync_episodes\n if episode[\'hasFile\'] is True:\nTypeError: string indices must be integers'

morpheus65535 commented 5 years ago

bazarr.log

Wrong issue?

junhinhow commented 5 years ago

yeap.. sorry... wrong tab!