Skip to content

Commit 4536f25

Browse files
committed
Fehler beim Herunterladen von Serienepisoden mit Umlauten behoben
1 parent c917285 commit 4536f25

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

resources/lib/downloader.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def download_movie( self, filmid, quality ):
9999
if len( namestem ) < 1 or confirmed is False:
100100
return
101101
# build year postfix
102-
year = self.matches( '([12][0-9][0-9][0-9])', film.aired )
102+
year = self.matches( '([12][0-9][0-9][0-9])', str( film.aired ) )
103103
if year is not None:
104104
postfix = ' (%s)' % year
105105
else:
@@ -238,10 +238,10 @@ def make_movie_nfo_file( self, film, filmurl, pathname, filename ):
238238
nfofile.write( bytearray( '\t<title>{}</title>\n'.format( film.title ), 'utf-8' ) )
239239
nfofile.write( bytearray( '\t<plot>{}</plot>\n'.format( film.description ), 'utf-8' ) )
240240
nfofile.write( bytearray( '\t<studio>{}</studio>\n'.format( film.channel ), 'utf-8' ) )
241-
aired = self.matches( '([12][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9])', film.aired )
241+
aired = self.matches( '([12][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9])', str( film.aired ) )
242242
if aired is not None:
243243
nfofile.write( bytearray( '\t<aired>{}</aired>\n'.format( aired ), 'utf-8' ) )
244-
year = self.matches( '([12][0-9][0-9][0-9])', film.aired )
244+
year = self.matches( '([12][0-9][0-9][0-9])', str( film.aired ) )
245245
if year is not None:
246246
nfofile.write( bytearray( '\t<year>{}</year>\n'.format( year ), 'utf-8' ) )
247247
if film.seconds > 60:
@@ -263,8 +263,8 @@ def make_series_nfo_files( self, film, filmurl, pathname, filename, season, epis
263263
# See: https://kodi.wiki/view/NFO_files/TV_shows
264264
# pylint: disable=broad-except
265265
if self.settings.makenfo > 0:
266-
aired = self.matches( '([12][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9])', film.aired )
267-
year = self.matches( '([12][0-9][0-9][0-9])', film.aired )
266+
aired = self.matches( '([12][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9])', str( film.aired ) )
267+
year = self.matches( '([12][0-9][0-9][0-9])', str( film.aired ) )
268268
if not xbmcvfs.exists( pathname + 'tvshow.nfo' ):
269269
try:
270270
# bug of pylint 1.7.1 - See https://github.com/PyCQA/pylint/issues/1444
@@ -319,6 +319,8 @@ def make_series_nfo_files( self, film, filmurl, pathname, filename, season, epis
319319

320320
def season_and_episode_detect( self, film ):
321321
# initial trivial implementation
322+
self.plugin.error( 'film.show is type {}', type( film.show ) )
323+
self.plugin.error( 'film.title is type {}', type( film.title ) )
322324
season = self.matches( r'staffel[\.:\- ]+([0-9]+)', film.title )
323325
if season is None:
324326
season = self.matches( r'([0-9]+)[\.:\- ]+staffel', film.title )
@@ -353,7 +355,7 @@ def season_and_episode_detect( self, film ):
353355
@staticmethod
354356
def matches( regex, test ):
355357
if test is not None:
356-
match = re.search( regex, str( test ), flags = re.IGNORECASE )
358+
match = re.search( regex, test, flags = re.IGNORECASE )
357359
if match and match.groups():
358360
return match.group(1)
359361
return None

0 commit comments

Comments
 (0)