@@ -745,7 +745,7 @@ def downloadUrl(self, url, threadData):
745745 archivePlaylist = str (self .archiveString )
746746 catchupList = archivePlaylist .split (', ' )
747747
748- p = re .compile ('service=playlist_\d&cid=\d+_AR.*' )
748+ p = re .compile (r 'service=playlist_\d&cid=\d+_AR.*' )
749749
750750 if not p .match (url ):
751751 return False
@@ -770,7 +770,7 @@ def downloadUrl(self, url, threadData):
770770 strmUrl = strmUrl_catchup .format (utc = utc , lutc = lutc )
771771
772772 if 'mono' in strmUrl :
773- strmUrl = re .sub ('\$' , '' , str (strmUrl ))
773+ strmUrl = re .sub (r '\$' , '' , str (strmUrl ))
774774 strmUrl = re .sub ('mono' , 'video' , str (strmUrl ))
775775 else :
776776 deb ('archive_type(4) wrong type' )
@@ -784,7 +784,7 @@ def downloadUrl(self, url, threadData):
784784
785785 # Default
786786 if ADDON .getSetting ('archive_type' ) == '0' :
787- matches = re .compile ('^(http[s]?://[^/]+)/([^/]+)/([^/]*)(mpegts|\ \ .m3u8)(\\ ?.+=.+)?$' )
787+ matches = re .compile (r '^(http[s]?://[^/]+)/([^/]+)/([^/]*)(mpegts|\.m3u8)(\\?.+=.+)?$' )
788788
789789 catchupList = ['hls-custom' , 'mono' ]
790790
@@ -874,10 +874,10 @@ def downloadUrl(self, url, threadData):
874874 if ADDON .getSetting ('archive_type' ) == '1' :
875875 setting = ADDON .getSetting ('archive_string' )
876876
877- putc = re .compile ('(^\?utc=|^\&utc=)' )
877+ putc = re .compile (r '(^\?utc=|^\&utc=)' )
878878 mutc = putc .match (setting )
879879
880- putv = re .compile ('(^.*)(\{Y\}.\{m\}.\{d\}.*\{H\}.\{M\}.\{S\})(?=.*|$)' )
880+ putv = re .compile (r '(^.*)(\{Y\}.\{m\}.\{d\}.*\{H\}.\{M\}.\{S\})(?=.*|$)' )
881881 mutv = putv .match (setting )
882882
883883 if mutc :
@@ -886,15 +886,15 @@ def downloadUrl(self, url, threadData):
886886 elif mutv :
887887 catchup = ADDON .getSetting ('archive_string' ).format (Y = year , m = month , d = day , H = hour , M = minute , S = second )
888888
889- putc = re .compile ('(^\?utc=|^\&utc=)' )
889+ putc = re .compile (r '(^\?utc=|^\&utc=)' )
890890 mutc = putc .match (catchup )
891891
892- putv = re .compile ('(^.*)(\d{4}.\d{2}.\d{2}.*\d{2}.\d{2}.\d{2})(?=.*|$)' )
892+ putv = re .compile (r '(^.*)(\d{4}.\d{2}.\d{2}.*\d{2}.\d{2}.\d{2})(?=.*|$)' )
893893 mutv = putv .match (catchup )
894894
895895 m_catchupSource = strmUrl + catchup
896896
897- if mutc :
897+ if mutc :
898898 strmUrl = m_catchupSource + '-' + str (int (duration )* 60 )
899899
900900 elif mutv :
@@ -911,7 +911,7 @@ def downloadUrl(self, url, threadData):
911911
912912 # Xtream Codes
913913 if ADDON .getSetting ('archive_type' ) == '2' :
914- matches = re .compile ('^(http[s]?://[^/]+)/(?:live/)?([^/]+)/([^/]+)/([^/\\ .]+)(\\ .m3u[8]?|\ \ .ts)?$' )
914+ matches = re .compile (r '^(http[s]?://[^/]+)/(?:live/)?([^/]+)/([^/]+)/([^/\\.]+)(\.m3u[8]?|\.ts)?$' )
915915
916916 if matches .match (strmUrl ):
917917 xcHost = matches .search (strmUrl ).group (1 )
@@ -1003,7 +1003,7 @@ def download(self, recordCommand, threadData):
10031003 self .downloading = True
10041004
10051005 for line in threadData ['downloadHandle' ].stdout :
1006- p = re .compile ('.*time=(.*?)\s' )
1006+ p = re .compile (r '.*time=(.*?)\s' )
10071007
10081008 i = 1
10091009
@@ -1117,8 +1117,6 @@ def generateFFMPEGDownloadCommand(self, channelInfo, programDuration, destinatio
11171117 recordCommand = list ()
11181118 recordCommand .append (self .ffmpegdumpExe )
11191119
1120- duration = datetime .timedelta (seconds = int (programDuration ))
1121-
11221120 streamSource = channelInfo .strm
11231121
11241122 cookieSeparator = streamSource .find ('|' )
@@ -1129,7 +1127,7 @@ def generateFFMPEGDownloadCommand(self, channelInfo, programDuration, destinatio
11291127
11301128 headers = removedCookie .split ('&' )
11311129 newHeader = ""
1132- newCookie = ""
1130+ newCookie = ""
11331131
11341132 UA = serviceLib .HOST
11351133
@@ -1197,7 +1195,7 @@ def generateFFMPEGDownloadCommand(self, channelInfo, programDuration, destinatio
11971195 recordCommand .append ("h264_mp4toannexb" )
11981196
11991197 recordCommand .append ("-t" )
1200- recordCommand .append (str ( duration ))
1198+ recordCommand .append ("{}" . format ( programDuration ))
12011199 recordCommand .append ("-loglevel" )
12021200 recordCommand .append ("info" )
12031201 recordCommand .append ("-n" )
0 commit comments