Repository: Flexget/Flexget

Issue:
TVMaze does not return shows with Unicode chars
TVMaze does not return shows with Unicode chars

```
2015-12-06 05:22 DEBUG    api_tvmaze    Series-Premieres returning search params for series lookup: {u'tvdb_id': None, u'tvmaze_id': None, u'name': u'Unit\xe9 9', u'tvrage_id': None}
2015-12-06 05:22 DEBUG    api_tvmaze    Series-Premieres searching db tvmaze_series for the values [(u'tvdb_id', None), (u'tvmaze_id', None), (u'name', u'Unit\xe9 9'), (u'tvrage_id', None)]
2015-12-06 05:22 DEBUG    api_tvmaze    Series-Premieres did not find exact match for series Unité 9 in cache, looking in search table
2015-12-06 05:22 DEBUG    api_tvmaze    Series-Premieres searching lookup table using title Unité 9
2015-12-06 05:22 DEBUG    api_tvmaze    Series-Premieres trying to fetch series Unité 9 from pytvmaze
2015-12-06 05:22 DEBUG    tvmaze_lookup Series-Premieres é
```

This is actually a pytvmaze issue, opened this as a placeholder that will be closed when the bug will be fixed on their side.



Discussion:

Resolving patch:
diff --git a/flexget/plugins/api_tvmaze.py b/flexget/plugins/api_tvmaze.py
--- a/flexget/plugins/api_tvmaze.py
+++ b/flexget/plugins/api_tvmaze.py
@@ -6,7 +6,7 @@
 from dateutil import parser
 from pytvmaze import get_show, episode_by_number, episodes_by_date
 from pytvmaze.exceptions import ShowNotFound, EpisodeNotFound, NoEpisodesForAirdate, IllegalAirDate, ConnectionError
-from sqlalchemy import Column, Integer, DateTime, String, Unicode, ForeignKey, Numeric, PickleType, func, Table, or_, \
+from sqlalchemy import Column, Integer, Float, DateTime, String, Unicode, ForeignKey, Numeric, PickleType, func, Table, or_, \
     and_
 from sqlalchemy.orm import relation
 
@@ -17,11 +17,18 @@
 
 log = logging.getLogger('api_tvmaze')
 
-DB_VERSION = 0
+DB_VERSION = 1
 Base = db_schema.versioned_base('tvmaze', DB_VERSION)
 UPDATE_INTERVAL = 7  # Used for expiration, number is in days
 
 
+@db_schema.upgrade('tvmaze')
+def upgrade(ver, session):
+    if ver == 0:
+        raise db_schema.UpgradeImpossible
+    return ver
+
+
 class TVMazeGenre(Base):
     __tablename__ = 'tvmaze_genres'
 
@@ -48,7 +55,7 @@ class TVMazeSeries(Base):
 
     tvmaze_id = Column(Integer, primary_key=True)
     status = Column(Unicode)
-    rating = Column(Numeric)
+    rating = Column(Float)
     genres = relation(TVMazeGenre, secondary=genres_table)
     weight = Column(Integer)
     updated = Column(DateTime)  # last time show was updated at tvmaze
@@ -145,6 +152,7 @@ class TVMazeEpisodes(Base):
     medium_image = Column(String)
     airstamp = Column(DateTime)
     runtime = Column(Integer)
+    summary = Column(Unicode)
     last_update = Column(DateTime)
 
     def __init__(self, episode, series_id):
@@ -155,6 +163,7 @@ def __init__(self, episode, series_id):
         self.update(episode)
 
     def update(self, episode):
+        self.summary = episode.summary
         self.title = episode.title
         if episode.airdate:
             self.airdate = datetime.strptime(episode.airdate, '%Y-%m-%d')
diff --git a/flexget/plugins/metainfo/tvmaze_lookup.py b/flexget/plugins/metainfo/tvmaze_lookup.py
--- a/flexget/plugins/metainfo/tvmaze_lookup.py
+++ b/flexget/plugins/metainfo/tvmaze_lookup.py
@@ -107,6 +107,7 @@ class PluginTVMazeLookup(object):
         'tvmaze_episode_id': 'tvmaze_id',
         'tvmaze_episode_airdate': 'airdate',
         'tvmaze_episode_url': 'url',
+        'tvmaze_episode_summary': 'summary',
         'tvmaze_episode_original_image': 'original_image',
         'tvmaze_episode_medium_image': 'medium_image',
         'tvmaze_episode_airstamp': 'airstamp',
diff --git a/pavement.py b/pavement.py
--- a/pavement.py
+++ b/pavement.py
@@ -33,7 +33,7 @@
     'tmdb3', 'path.py', 'guessit>=0.9.3, <0.10.4', 'apscheduler',
     'flask>=0.7', 'flask-restful>=0.3.3', 'ordereddict>=1.1', 'flask-restplus==0.7.2', 'cherrypy>=3.7.0',
     'flask-assets>=0.11', 'cssmin>=0.2.0', 'flask-compress>=1.2.1', 'flask-login>=0.3.2', 'pyparsing>=2.0.3',
-    'pyScss>=1.3.4', 'pytvmaze>=1.3.7'
+    'pyScss>=1.3.4', 'pytvmaze>=1.3.9'
 ]
 
 if sys.version_info < (2, 7):


Test patch:
diff --git a/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_episode_summary b/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_episode_summary
new file mode 100644
--- /dev/null
+++ b/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_episode_summary
@@ -0,0 +1,116 @@
+interactions:
+- request:
+    body: null
+    headers:
+      Connection: [close]
+      Host: [api.tvmaze.com]
+      User-Agent: [Python-urllib/2.7]
+    method: GET
+    uri: http://api.tvmaze.com/search/shows?q=The%20Flash
+  response:
+    body: {string: !!python/unicode '[{"score":3.319403,"show":{"id":13,"url":"http://www.tvmaze.com/shows/13/the-flash","name":"The
+        Flash","type":"Scripted","language":"English","genres":["Action","Adventure","Fantasy"],"status":"Running","runtime":60,"premiered":"2014-10-07","schedule":{"time":"20:00","days":["Tuesday"]},"rating":{"average":8.4},"weight":65,"network":{"id":5,"name":"The
+        CW","country":{"name":"United States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":36939,"thetvdb":279121},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/23/59290.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/23/59290.jpg"},"summary":"<p>After
+        a particle accelerator causes a freak storm, CSI Investigator Barry Allen
+        is struck by lightning and falls into a coma. Months later he awakens with
+        the power of super speed, granting him the ability to move through Central
+        City like an unseen guardian angel. Though initially excited by his newfound
+        powers, Barry is shocked to discover he is not the only \"meta-human\" who
+        was created in the wake of the accelerator explosion -- and not everyone is
+        using their new powers for good. Barry partners with S.T.A.R. Labs and dedicates
+        his life to protect the innocent. For now, only a few close friends and associates
+        know that Barry is literally the fastest man alive, but it won''t be long
+        before the world learns what Barry Allen has become...The Flash.</p>","updated":1449634899,"_links":{"self":{"href":"http://api.tvmaze.com/shows/13"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/426089"},"nextepisode":{"href":"http://api.tvmaze.com/episodes/510531"}}}},{"score":2.617883,"show":{"id":528,"url":"http://www.tvmaze.com/shows/528/the-flash","name":"The
+        Flash","type":"Scripted","language":"English","genres":["Action","Adventure","Science-Fiction"],"status":"Ended","runtime":60,"premiered":"1990-09-20","schedule":{"time":"20:30","days":[]},"rating":{"average":8.7},"weight":2,"network":{"id":2,"name":"CBS","country":{"name":"United
+        States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":5781,"thetvdb":78650},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/4/11360.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/4/11360.jpg"},"summary":"<p>Barry
+        Allen, a police scientist, is working one night during a terrible thunder
+        storm when a bolt of lightning crashes through the lab window, electrocuting
+        him. Barry survives and soon learns that he is now able to move at almost
+        incomprehensible speed.</p>","updated":1444404348,"_links":{"self":{"href":"http://api.tvmaze.com/shows/528"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/47947"}}}},{"score":2.6022325,"show":{"id":7079,"url":"http://www.tvmaze.com/shows/7079/the-flash","name":"The
+        Flash","type":"Animation","language":"English","genres":["Action","Adventure","Children"],"status":"Ended","runtime":7,"premiered":"1967-11-11","schedule":{"time":"","days":["Saturday"]},"rating":{"average":null},"weight":1,"network":{"id":2,"name":"CBS","country":{"name":"United
+        States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":null,"thetvdb":272094},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/29/73727.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/29/73727.jpg"},"summary":"<p>The
+        Flash is--of course!--the fastest man alive. Barry Allen, otherwise known
+        as the Flash, and his sidekick Wally West, otherwise known as Kid Flash, battle
+        evil villains and aliens who try to cause mayhem on Earth. They can outrun
+        a bullet, vibrate through solid walls, and do all sorts of other things with
+        their incredible speed. When there is trouble, Barry and Wally open up their
+        rings which shoot out their costumes.</p>","updated":1447263873,"_links":{"self":{"href":"http://api.tvmaze.com/shows/7079"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/406494"}}}},{"score":1.8097742,"show":{"id":7719,"url":"http://www.tvmaze.com/shows/7719/the-flush","name":"The
+        Flush","type":"Reality","language":"English","genres":[],"status":"Running","runtime":30,"premiered":"2012-06-27","schedule":{"time":"17:30","days":["Saturday"]},"rating":{"average":null},"weight":0,"network":{"id":207,"name":"Outdoor
+        Channel","country":{"name":"United States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":null,"thetvdb":null},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/33/83404.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/33/83404.jpg"},"summary":"<p><strong><em>\"The\n
+        Flush\"</em></strong> will make your heart thump! \"The Flush\" takes upland
+        hunting \nand the work of Pheasants Forever to new heights on Outdoor Channel.
+        \nEmmy award-winning hosts Bill Sherck and Ron Schara team up to guide \nviewers
+        on some of North America''s most profound and most exciting \nhunts. Each
+        trip highlights the work and dedication of Pheasants Forever\n supporters
+        and promotes the mission of the nation''s most efficient \nconservation organization.
+        Be prepared to be surprised! \"The Flush\" \ndocuments bird hunts like you''ve
+        never seen before! </p>","updated":1449344898,"_links":{"self":{"href":"http://api.tvmaze.com/shows/7719"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/433116"}}}},{"score":1.6234447,"show":{"id":999,"url":"http://www.tvmaze.com/shows/999/flash-gordon","name":"Flash
+        Gordon","type":"Scripted","language":"English","genres":["Science-Fiction"],"status":"Ended","runtime":60,"premiered":"2007-08-10","schedule":{"time":"21:00","days":[]},"rating":{"average":5.7},"weight":0,"network":{"id":16,"name":"SyFy","country":{"name":"United
+        States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":15536,"thetvdb":80441},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/6/16548.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/6/16548.jpg"},"summary":"<p>Placing
+        a 21st century spin on a science fiction classic, SCI FI''s contemporized
+        version of Flash Gordon follows the all-new adventures of Flash (Eric Johnson)
+        and his companions, Dale Arden and Dr. Hans Zarkov. Ordinary people thrust
+        into extraordinary circumstances, they find themselves as Earth''s last line
+        of defense against the forces of the merciless dictator Ming.<br /></p>","updated":1442953579,"_links":{"self":{"href":"http://api.tvmaze.com/shows/999"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/98788"}}}},{"score":0.9048871,"show":{"id":4975,"url":"http://www.tvmaze.com/shows/4975/clash-of-the-dinosaurs","name":"Clash
+        of the Dinosaurs","type":"Documentary","language":"English","genres":[],"status":"Ended","runtime":45,"premiered":"2009-12-06","schedule":{"time":"20:00","days":["Sunday"]},"rating":{"average":null},"weight":0,"network":{"id":66,"name":"Discovery
+        Channel","country":{"name":"United States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":24446,"thetvdb":128551},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/21/54113.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/21/54113.jpg"},"summary":"<p>For
+        the first time in 65 million years, innovative imaging technology enables
+        viewers to see deep inside the body of a dinosaur to reveal the secrets of
+        these ultimate prehistoric survival machines. Combining cinematic photo-real
+        3d graphics and leading-edge anatomy and paleontology, \"Clash of the Dinosaurs\"
+        is a four-part special that peels back the skin, muscles and bones to show
+        how they survived in such a violent world.</p>","updated":1448781557,"_links":{"self":{"href":"http://api.tvmaze.com/shows/4975"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/312862"}}}},{"score":0.86235726,"show":{"id":2760,"url":"http://www.tvmaze.com/shows/2760/flesh-and-bone","name":"Flesh
+        and Bone","type":"Scripted","language":"English","genres":["Drama"],"status":"Ended","runtime":60,"premiered":"2015-11-08","schedule":{"time":"20:00","days":["Sunday"]},"rating":{"average":8.2},"weight":8,"network":{"id":17,"name":"starz","country":{"name":"United
+        States","code":"US","timezone":"America/New_York"}},"webChannel":{"id":46,"name":"Starz
+        Play","country":{"name":"United States","code":"US","timezone":"America/New_York"}},"externals":{"tvrage":39079,"thetvdb":282400},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/14/37166.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/14/37166.jpg"},"summary":"<p>Described
+        as a dark and gritty exploration of the dysfunction and glamour of the ballet
+        world, <strong><em>\"Flesh And Bone\"</em></strong> follows a young ballet
+        dancer, Claire, who has a distinctly troubled past, as she joins a prestigious
+        ballet company in New York.</p>","updated":1449552277,"_links":{"self":{"href":"http://api.tvmaze.com/shows/2760"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/228272"},"nextepisode":{"href":"http://api.tvmaze.com/episodes/228273"}}}},{"score":0.7660178,"show":{"id":5035,"url":"http://www.tvmaze.com/shows/5035/hank-parkers-flesh-blood","name":"Hank
+        Parker''s Flesh & Blood","type":"Reality","language":"English","genres":[],"status":"Running","runtime":30,"premiered":"2013-07-02","schedule":{"time":"19:30","days":["Tuesday"]},"rating":{"average":null},"weight":0,"network":{"id":207,"name":"Outdoor
+        Channel","country":{"name":"United States","code":"US","timezone":"America/New_York"}},"webChannel":null,"externals":{"tvrage":null,"thetvdb":null},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/21/54294.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/21/54294.jpg"},"summary":"<p><strong><em>\"Hank\n
+        Parker''s Flesh &amp; Blood\"</em></strong> is a family hunting show that
+        features Hank\n Parker, two-time Bassmaster Classic Champion. Hank and his
+        two sons \nHank Parker Jr. and Billy \"Catfish\" Parker, who started their
+        careers in\n NASCAR as drivers, hunt big game, share a few laughs, and giving
+        back \nto organizations such as Outdoor Dream Foundation, Outdoor Without
+        \nLimits, and more. Follow these hunters as the Parker family dynamic is \nrevealed
+        while in pursuit of big game.</p>","updated":1449528645,"_links":{"self":{"href":"http://api.tvmaze.com/shows/5035"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/519698"}}}},{"score":0.6898858,"show":{"id":669,"url":"http://www.tvmaze.com/shows/669/in-the-flesh","name":"In
+        the Flesh","type":"Scripted","language":"English","genres":["Drama","Horror"],"status":"Ended","runtime":60,"premiered":"2013-03-17","schedule":{"time":"22:00","days":["Sunday"]},"rating":{"average":7},"weight":0,"network":{"id":49,"name":"BBC
+        Three","country":{"name":"United Kingdom","code":"GB","timezone":"Europe/London"}},"webChannel":null,"externals":{"tvrage":34747,"thetvdb":261742},"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_portrait/32/80591.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/32/80591.jpg"},"summary":"<p>Set
+        after a zombie uprising, treated zombies are rehabilitated back into society.</p>","updated":1448604471,"_links":{"self":{"href":"http://api.tvmaze.com/shows/669"},"previousepisode":{"href":"http://api.tvmaze.com/episodes/59013"}}}}]'}
+    headers:
+      access-control-allow-origin: ['*']
+      cache-control: ['public, max-age=3600']
+      connection: [close]
+      content-type: [application/json; charset=UTF-8]
+      date: ['Wed, 09 Dec 2015 08:44:45 GMT']
+      server: [nginx/1.4.6 (Ubuntu)]
+      x-powered-by: [PHP/5.5.9-1ubuntu4.11]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Connection: [close]
+      Host: [api.tvmaze.com]
+      User-Agent: [Python-urllib/2.7]
+    method: GET
+    uri: http://api.tvmaze.com/shows/13/episodebynumber?season=2&number=2
+  response:
+    body: {string: !!python/unicode '{"id":211206,"url":"http://www.tvmaze.com/episodes/211206/the-flash-2x02-flash-of-two-worlds","name":"Flash
+        of Two Worlds","season":2,"number":2,"airdate":"2015-10-13","airtime":"20:00","airstamp":"2015-10-13T20:00:00-04:00","runtime":60,"image":{"medium":"http://tvmazecdn.com/uploads/images/medium_landscape/23/59298.jpg","original":"http://tvmazecdn.com/uploads/images/original_untouched/23/59298.jpg"},"summary":"<p>The
+        team''s visitors, Jay Garrick, explains that he comes from a parallel world
+        and was a speedster there, but lost his powers transitioning over. Now he
+        insists that Barry needs his help fighting a new metahuman, Sand Demon, who
+        came from Jay''s world. Meanwhile, Officer Patty Spivot tries to join Joe''s
+        Metahuman Taskforce.</p>","_links":{"self":{"href":"http://api.tvmaze.com/episodes/211206"}}}'}
+    headers:
+      access-control-allow-origin: ['*']
+      cache-control: ['public, max-age=3600']
+      connection: [close]
+      content-type: [application/json; charset=UTF-8]
+      date: ['Wed, 09 Dec 2015 08:44:45 GMT']
+      server: [nginx/1.4.6 (Ubuntu)]
+      x-powered-by: [PHP/5.5.9-1ubuntu4.11]
+    status: {code: 200, message: OK}
+version: 1
diff --git a/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_show_with_non_ascii_chars b/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_show_with_non_ascii_chars
new file mode 100644
--- /dev/null
+++ b/tests/cassettes/test_tvmaze.TestTVMazeShowLookup.test_show_with_non_ascii_chars
@@ -0,0 +1,52 @@
+interactions:
+- request:
+    body: null
+    headers:
+      Connection: [close]
+      Host: [api.tvmaze.com]
+      User-Agent: [Python-urllib/2.7]
+    method: GET
+    uri: http://api.tvmaze.com/search/shows?q=Unite%209
+  response:
+    body: {string: "[{\"score\":1.2881234,\"show\":{\"id\":8652,\"url\":\"http://www.tvmaze.com/shows/8652/unite-9\",\"name\":\"Unit\xE9
+        9\",\"type\":\"Scripted\",\"language\":\"French\",\"genres\":[],\"status\":\"Running\",\"runtime\":45,\"premiered\":\"2012-09-11\",\"schedule\":{\"time\":\"20:00\",\"days\":[\"Wednesday\"]},\"rating\":{\"average\":null},\"weight\":0,\"network\":{\"id\":451,\"name\":\"ICI
+        Radio-Canada T\xE9l\xE9\",\"country\":{\"name\":\"Canada\",\"code\":\"CA\",\"timezone\":\"Canada/Atlantic\"}},\"webChannel\":null,\"externals\":{\"tvrage\":null,\"thetvdb\":261952},\"image\":{\"medium\":\"http://tvmazecdn.com/uploads/images/medium_portrait/30/77041.jpg\",\"original\":\"http://tvmazecdn.com/uploads/images/original_untouched/30/77041.jpg\"},\"summary\":\"\",\"updated\":1448242776,\"_links\":{\"self\":{\"href\":\"http://api.tvmaze.com/shows/8652\"},\"previousepisode\":{\"href\":\"http://api.tvmaze.com/episodes/485612\"}}}},{\"score\":0.37501508,\"show\":{\"id\":382,\"url\":\"http://www.tvmaze.com/shows/382/aqua-teen-hunger-force\",\"name\":\"Aqua
+        Teen Hunger Force\",\"type\":\"Animation\",\"language\":\"English\",\"genres\":[\"Action\",\"Adventure\"],\"status\":\"Ended\",\"runtime\":15,\"premiered\":\"2000-12-30\",\"schedule\":{\"time\":\"23:59\",\"days\":[\"Sunday\"]},\"rating\":{\"average\":8},\"weight\":0,\"network\":{\"id\":10,\"name\":\"Adult
+        Swim\",\"country\":{\"name\":\"United States\",\"code\":\"US\",\"timezone\":\"America/New_York\"}},\"webChannel\":null,\"externals\":{\"tvrage\":2638,\"thetvdb\":77120},\"image\":{\"medium\":\"http://tvmazecdn.com/uploads/images/medium_portrait/13/34785.jpg\",\"original\":\"http://tvmazecdn.com/uploads/images/original_untouched/13/34785.jpg\"},\"summary\":\"<p>Aqua
+        Teen Hunger Force follows the adventures of the aptly named Aqua Teen Hunger
+        Force, a group of mystery-solving fast food items. The team consists of Master
+        Shake, or Shake, a rather sadistic, lazy, ordering milkshake who loves to
+        torture Meatwad. Frylock, the floating box of fries, is the brains the group,
+        and contains the one thing that the rest of the group lacks: common sense.
+        Meatwad is a loving, caring, gentle ball of meat that crawls wherever he goes,
+        who is frequently tortured by Shake.</p>\",\"updated\":1445178594,\"_links\":{\"self\":{\"href\":\"http://api.tvmaze.com/shows/382\"},\"previousepisode\":{\"href\":\"http://api.tvmaze.com/episodes/201210\"}}}}]"}
+    headers:
+      access-control-allow-origin: ['*']
+      cache-control: ['public, max-age=3600']
+      connection: [close]
+      content-type: [application/json; charset=UTF-8]
+      date: ['Wed, 09 Dec 2015 09:08:06 GMT']
+      server: [nginx/1.4.6 (Ubuntu)]
+      x-powered-by: [PHP/5.5.9-1ubuntu4.11]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Connection: [close]
+      Host: [api.tvmaze.com]
+      User-Agent: [Python-urllib/2.7]
+    method: GET
+    uri: http://api.tvmaze.com/shows/8652/episodebynumber?season=1&number=16
+  response:
+    body: {string: !!python/unicode '{"id":476294,"url":"http://www.tvmaze.com/episodes/476294/unite-9-1x16-episode-16","name":"Episode
+        16","season":1,"number":16,"airdate":"2013-01-22","airtime":"20:00","airstamp":"2013-01-22T20:00:00-04:00","runtime":45,"image":null,"summary":"","_links":{"self":{"href":"http://api.tvmaze.com/episodes/476294"}}}'}
+    headers:
+      access-control-allow-origin: ['*']
+      cache-control: ['public, max-age=3600']
+      connection: [close]
+      content-type: [application/json; charset=UTF-8]
+      date: ['Wed, 09 Dec 2015 09:08:06 GMT']
+      server: [nginx/1.4.6 (Ubuntu)]
+      x-powered-by: [PHP/5.5.9-1ubuntu4.11]
+    status: {code: 200, message: OK}
+version: 1
diff --git a/tests/test_tvmaze.py b/tests/test_tvmaze.py
--- a/tests/test_tvmaze.py
+++ b/tests/test_tvmaze.py
@@ -84,7 +84,16 @@ class TestTVMazeShowLookup(FlexGetBase):
               - Firefly
             set:
               bfield: "{{tvmaze_episode_airdate}}{{tvmaze_episode_airstamp}}"
-
+          test_episode_summary:
+            mock:
+              - {title: 'The.Flash.2014.S02E02.HDTV.x264-LOL'}
+            series:
+              - The Flash
+          test_show_with_non_ascii_chars:
+            mock:
+              - {title: 'Unite 9 S01E16 VFQ HDTV XviD-bLinKkY'}
+            series:
+              - Unite 9
     """
 
     @use_vcr
@@ -285,3 +294,31 @@ def test_episode_without_air_date_and_air_stamp(self):
             'Expected airdate to be None, got %s' % entry['tvmaze_episode_airdate']
         assert entry['tvmaze_episode_airstamp'] == None, \
             'Expected airdate to be None, got %s' % entry['tvmaze_episode_airstamp']
+
+    @use_vcr()
+    def test_episode_summary(self):
+        expected_summary = u"The team's visitors, Jay Garrick, explains that he comes from a parallel world" \
+                           u" and was a speedster there, but lost his powers transitioning over. Now he insists" \
+                           u" that Barry needs his help fighting a new metahuman, Sand Demon, who came from" \
+                           u" Jay's world. Meanwhile, Officer Patty Spivot tries to join Joe's Metahuman Taskforce."
+
+        self.execute_task('test_episode_summary')
+        entry = self.task.entries[0]
+        assert entry['tvmaze_series_id'] == 13, 'series id should be 13, instead its %s' % entry[
+            'tvmaze_series_id']
+        assert entry['tvmaze_episode_id'] == 211206, 'episode id should be 211206, instead its %s' % entry[
+            'tvmaze_episode_id']
+        assert entry['tvmaze_episode_summary'] == expected_summary, 'Expected summary is different %s' % entry[
+            'tvmaze_episode_summary']
+
+    @use_vcr()
+    def test_show_with_non_ascii_chars(self):
+        self.execute_task('test_show_with_non_ascii_chars')
+        entry = self.task.entries[0]
+        assert entry['tvmaze_series_name'] == u'Unit\xe9 9', u'series id should be Unit\xe9 9, instead its %s' % entry[
+            'tvmaze_series_name']
+        assert entry['tvmaze_series_id'] == 8652, 'series id should be 8652, instead its %s' % entry[
+            'tvmaze_series_id']
+        assert entry['tvmaze_episode_id'] == 476294, 'episode id should be 476294, instead its %s' % entry[
+            'tvmaze_episode_id']
+