Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin.video.retrospect] v5.0.7 #2557

Merged
merged 1 commit into from
Oct 10, 2019
Merged

Conversation

basrieter
Copy link
Contributor

@basrieter basrieter commented Oct 9, 2019

Description

The NPO channel broke and I added the Swedish MTV and National Geographic. Also removed the update notification.

I also created a PR for the new resources: xbmc/repo-resources#81

Checklist:

  • My code follows the add-on rules and piracy stance of this project.
  • I have read the CONTRIBUTING document
  • Each add-on submission should be a single commit with using the following style: [plugin.video.foo] v1.0.0

Additional information :

  • Submitting your add-on to this specific branch makes it available to any Kodi version equal or higher than the branch name with the applicable Kodi dependencies limits.
  • add-on development wiki page.
  • Kodi pydocs provide information about the Python API
  • PEP8 codingstyle which is considered best practice but not mandatory.
  • This add-on repository has automated code guideline check which could help you improve your coding. You can find the results of these check at Codacy. You can create your own account as well to continuously monitor your python coding before submitting to repo.
  • Development questions can be asked in the add-on development section on the Kodi forum.
  • If you see no activity on your PR after a week (so at least one weekend has passed) then please go to the #kodi-dev freenode IRC channel to reach out to the team

@TravisBuddy
Copy link

Travis tests have failed

Hey @basrieter,
please read the following log in order to understand the failure reason. There might also be some helpful tips along the way.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

Expand here
INFO: Checking add-on plugin.video.retrospect
INFO: Created by Bas Rieter
INFO: Addon id matches folder name
INFO: Valid XML file found
ERROR: Version mismatch for required dependency resource.images.retrospect, required: 1.0.1, Available: 1.0.0
INFO: Image icon exists
INFO: Icon dimensions are fine 256x256
INFO: Image fanart exists
INFO: Fanart dimensions are fine 1920x1080
INFO: Image screenshot exists
INFO: Image screenshot exists
INFO: Image screenshot exists
WARN: Complex entry point. Check: default.py | Counted lines: 42 | Lines allowed: 15
INFO: ./plugin.video.retrospect/channels/channel.be/een/chn_een.py
--- ./plugin.video.retrospect/channels/channel.be/een/chn_een.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/een/chn_een.py	(refactored)
@@ -144,7 +144,7 @@
             400: "Karakters",
             413: "Het weer"
         }
-        if result_set["id"] in exclude.keys():
+        if result_set["id"] in list(exclude.keys()):
             return None
 
         # # dummy class
INFO: ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py
--- ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py	(refactored)
@@ -108,7 +108,7 @@
             "\a.: Catégories :.": "http://www.rtbf.be/news/api/menu?site=media"
         }
 
-        for k, v in sub_items.items():
+        for k, v in list(sub_items.items()):
             item = MediaItem(k, v)
             item.complete = True
             item.dontGroup = True
INFO: ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py
--- ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py	(refactored)
@@ -323,7 +323,7 @@
 
         items = []
 
-        for name, meta in self.__channelData.items():
+        for name, meta in list(self.__channelData.items()):
             if "metaCode" not in meta:
                 continue
 
@@ -382,7 +382,7 @@
         """
 
         items = []
-        for key_value, stream_value in result_set.items():
+        for key_value, stream_value in list(result_set.items()):
             Logger.trace(stream_value)
             # noinspection PyArgumentList
             channel_data = self.__channelData.get(key_value, None)
INFO: ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py
--- ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py	(original)
+++ ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py	(refactored)
@@ -79,7 +79,7 @@
         live_channels = {"SRF 1 live": ("c4927fcf-e1a0-0001-7edd-1ef01d441651", "srf1.png"),
                          "SRF zwei live": ("c49c1d64-9f60-0001-1c36-43c288c01a10", "srf2.png"),
                          "SRF info live": ("c49c1d73-2f70-0001-138a-15e0c4ccd3d0", "srfinfo.png")}
-        for live_item in live_channels.keys():
+        for live_item in list(live_channels.keys()):
             item = MediaItem(live_item, live_base % (live_channels[live_item][0],))
             item.thumb = self.get_image_location(live_channels[live_item][1])
             item.icon = self.icon
INFO: ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py
--- ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py	(refactored)
@@ -106,7 +106,7 @@
 
         json = JsonHelper(json_data[0])
         result = []
-        for key, value in json.json.items():
+        for key, value in list(json.json.items()):
             result.append(value)
             value["title"] = key
 
INFO: ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py
--- ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py	(original)
+++ ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py	(refactored)
@@ -167,7 +167,7 @@
             "A - Å": "https://psapi.nrk.no/medium/tv/letters?apiKey={}".format(self.__api_key),
             "Søk": "#searchSite"
         }
-        for name, url in links.items():
+        for name, url in list(links.items()):
             item = MediaItem(name, url)
             item.icon = self.icon
             item.thumb = self.noImage
INFO: ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py
--- ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py	(refactored)
@@ -679,7 +679,7 @@
             return item
 
         images = result_set["images"]
-        for image_type, image_data in images.items():
+        for image_type, image_data in list(images.items()):
             if image_type == "original" and "tv" in image_data["formats"]:
                 item.fanart = image_data["formats"]["tv"]["source"]
             elif image_type == "grid.tile":
@@ -896,7 +896,7 @@
 
         images = result_set["images"]
         item.fanart = self.parentItem.fanart
-        for image_type, image_data in images.items():
+        for image_type, image_data in list(images.items()):
             if image_type == "original" and "original" in image_data["formats"]:
                 pass
                 # No fanart for now.
INFO: ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py
--- ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py	(refactored)
@@ -173,7 +173,7 @@
                 if image["width"] >= 720:
                     matched_image = image
                     break
-            item.thumb = matched_image["url"].values()[0]
+            item.thumb = list(matched_image["url"].values())[0]
 
         item.description = result_set["description"]
         item.complete = False
@@ -219,7 +219,7 @@
         part = item.create_new_empty_media_part()
         urls = []
         for stream in streams:
-            url = stream["url"].values()[-1]
+            url = list(stream["url"].values())[-1]
             if url in urls:
                 # duplicate url, ignore
                 continue
INFO: ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py
--- ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py	(original)
+++ ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py	(refactored)
@@ -602,10 +602,10 @@
 
     # noinspection PyTypeChecker
     def __update_image_lookup(self, json_data):
-        images = filter(lambda a: a["type"] == "image", json_data.get_value("included"))
+        images = [a for a in json_data.get_value("included") if a["type"] == "image"]
         images = {str(image["id"]): image["attributes"]["src"] for image in images}
 
-        shows = filter(lambda a: a["type"] == "show", json_data.get_value("included"))
+        shows = [a for a in json_data.get_value("included") if a["type"] == "show"]
         shows = {str(show["id"]): show["attributes"]["name"] for show in shows}
         self.showLookup.update(shows)
         self.imageLookup.update(images)
@@ -690,9 +690,7 @@
         # paid or not?
         if "contentPackages" in result_set["relationships"]:
             item.isPaid = not any(
-                filter(
-                    lambda p: p["id"].lower() == "free", result_set["relationships"]["contentPackages"]["data"]
-                )
+                [p for p in result_set["relationships"]["contentPackages"]["data"] if p["id"].lower() == "free"]
             )
         else:
             item.isPaid = False
INFO: ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py
--- ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py	(original)
+++ ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py	(refactored)
@@ -162,7 +162,7 @@
             LanguageHelper.get_localized_string(LanguageHelper.MostViewedEpisodes): "https://www.svtplay.se/populara?sida=1",
         }
 
-        for title, url in extra_items.items():
+        for title, url in list(extra_items.items()):
             new_item = MediaItem("\a.: %s :." % (title, ), url)
             new_item.complete = True
             new_item.thumb = self.noImage
@@ -222,7 +222,7 @@
         new_item.complete = True
         new_item.thumb = self.noImage
         new_item.dontGroup = True
-        for title, (url, thumb) in category_items.items():
+        for title, (url, thumb) in list(category_items.items()):
             cat_item = MediaItem(title, url)
             cat_item.complete = True
             cat_item.thumb = thumb or self.noImage
@@ -266,7 +266,7 @@
 
         data, items = self.__extract_json_data(data, "(?:__svtplay_apollo)")
         self.__apollo_data = JsonHelper(data).json
-        for k, v in self.__apollo_data.items():
+        for k, v in list(self.__apollo_data.items()):
             item = self.create_json_genre_item(v)
             if item:
                 items.append(item)
@@ -702,7 +702,7 @@
         json_data = JsonHelper(json_string)
         channels = json_data.get_value("channelsPage", "schedule")
         channel_list = []
-        for channel_name, channel_data in channels.items():
+        for channel_name, channel_data in list(channels.items()):
             if "channel" not in channel_data:
                 continue
             channel_list.append(channel_data)
@@ -873,7 +873,7 @@
             Logger.debug("Found video item for format: %s", video_format)
 
             url = video['url']
-            if any(filter(lambda s: s.Url == url, part.MediaStreams)):
+            if any([s for s in part.MediaStreams if s.Url == url]):
                 Logger.debug("Skippping duplicate Stream url: %s", url)
                 continue
 
INFO: ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py
--- ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py	(original)
+++ ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py	(refactored)
@@ -477,7 +477,7 @@
         """
 
         items = []
-        for char, data in result_set.items():
+        for char, data in list(result_set.items()):
             shows = data.get("entities")
             if not shows:
                 continue
INFO: ./plugin.video.retrospect/resources/libs/addonsettings.py
--- ./plugin.video.retrospect/resources/libs/addonsettings.py	(original)
+++ ./plugin.video.retrospect/resources/libs/addonsettings.py	(refactored)
@@ -1280,7 +1280,7 @@
         for language in languages:
             language_lookup[language] = AddonSettings.__get_language_settings_id_and_label(language)
 
-        language_lookup_sorted_keys = sorted(language_lookup.keys(), key=lambda k: k or "")
+        language_lookup_sorted_keys = sorted(list(language_lookup.keys()), key=lambda k: k or "")
 
         for language in language_lookup_sorted_keys:
             channel_xml = '%s        <setting id="%s" type="bool" label="%s" subsetting="false" default="true" />\n' \
INFO: ./plugin.video.retrospect/resources/libs/chn_class.py
--- ./plugin.video.retrospect/resources/libs/chn_class.py	(original)
+++ ./plugin.video.retrospect/resources/libs/chn_class.py	(refactored)
@@ -897,14 +897,14 @@
         if url.startswith("#"):
             # let's handle the keyword url's
             Logger.trace("Found URL with labeled DataParser keyword [%s]", url)
-            if url in self.dataParsers.keys():
+            if url in list(self.dataParsers.keys()):
                 # use the parsers that is associated with No url (the None Parser)
                 data_parsers = self.dataParsers[url]
             else:
                 Logger.warning("no DataParser was found keyword [%s]. Continuing with other options.", url)
         else:
             # make sure we sort by keylength and then start with the longest one.
-            keys = sorted(self.dataParsers.keys(), key=len, reverse=True)
+            keys = sorted(list(self.dataParsers.keys()), key=len, reverse=True)
             # watch.lap("DataParsers sorted")
 
             # filter them in order
INFO: ./plugin.video.retrospect/resources/libs/mediaitem.py
--- ./plugin.video.retrospect/resources/libs/mediaitem.py	(original)
+++ ./plugin.video.retrospect/resources/libs/mediaitem.py	(refactored)
@@ -454,7 +454,7 @@
             stream_url = stream.Url
             if header_params:
                 kodi_query_string = reduce(
-                    lambda x, y: "%s&%s=%s" % (x, y, header_params[y]), header_params.keys(), "")
+                    lambda x, y: "%s&%s=%s" % (x, y, header_params[y]), list(header_params.keys()), "")
                 kodi_query_string = kodi_query_string.lstrip("&")
                 Logger.debug("Adding Kodi Stream parameters: %s\n%s", header_params, kodi_query_string)
                 stream_url = "%s|%s" % (stream.Url, kodi_query_string)
INFO: ./plugin.video.retrospect/resources/libs/paramparser.py
--- ./plugin.video.retrospect/resources/libs/paramparser.py	(original)
+++ ./plugin.video.retrospect/resources/libs/paramparser.py	(refactored)
@@ -116,7 +116,7 @@
             params[self.keywordCategory] = category
 
         url = "%s?" % (self.pluginName, )
-        for k in params.keys():
+        for k in list(params.keys()):
             url = "%s%s=%s&" % (url, k, params[k])
 
         url = url.strip('&')
INFO: ./plugin.video.retrospect/resources/libs/pickler.py
--- ./plugin.video.retrospect/resources/libs/pickler.py	(original)
+++ ./plugin.video.retrospect/resources/libs/pickler.py	(refactored)
@@ -49,7 +49,7 @@
 
         hex_string = hex_string.rstrip(' ')
         hex_string = reduce(lambda x, y: x.replace(y, Pickler.__Base64CharsDecode[y]),
-                            Pickler.__Base64CharsDecode.keys(),
+                            list(Pickler.__Base64CharsDecode.keys()),
                             hex_string)
 
         Logger.trace("DePickle: HexString: %s (might be truncated)", hex_string[0:256])
@@ -77,7 +77,7 @@
 
         # if not unquoted, we must replace the \n's for the URL
         hex_string = reduce(lambda x, y: x.replace(y, Pickler.__Base64CharsEncode[y]),
-                            Pickler.__Base64CharsEncode.keys(),
+                            list(Pickler.__Base64CharsEncode.keys()),
                             hex_string)
 
         self.__pickleContainer[item.guid] = hex_string
INFO: ./plugin.video.retrospect/resources/libs/urihandler.py
--- ./plugin.video.retrospect/resources/libs/urihandler.py	(original)
+++ ./plugin.video.retrospect/resources/libs/urihandler.py	(refactored)
@@ -227,7 +227,7 @@
             return None
 
         # do a startswith search
-        cookies = [c for c in cookies.values() if c.name.startswith(name)]
+        cookies = [c for c in list(cookies.values()) if c.name.startswith(name)]
         if not cookies:
             return None
         else:
@@ -522,7 +522,7 @@
     def __get_headers(self, referer, additional_headers):
         headers = {}
         if additional_headers:
-            for k, v in additional_headers.items():
+            for k, v in list(additional_headers.items()):
                 headers[k.lower()] = v
 
         if "user-agent" not in headers:
INFO: ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py
--- ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py	(original)
+++ ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py	(refactored)
@@ -237,7 +237,7 @@
             "body": body_key,
             "url": res.url,
             "headers": dict(
-                (k, v) for k, v in res.headers.items()
+                (k, v) for k, v in list(res.headers.items())
             ),
             "status": res.status_code,
             "reason": res.reason,
INFO: ./plugin.video.retrospect/resources/libs/streams/npostream.py
--- ./plugin.video.retrospect/resources/libs/streams/npostream.py	(original)
+++ ./plugin.video.retrospect/resources/libs/streams/npostream.py	(refactored)
@@ -101,7 +101,7 @@
             Logger.info("Using encrypted Dash for NPO")
             license_headers = stream_data.get_value("stream", "keySystemOptions", 0, "options", "httpRequestHeaders")
             if license_headers:
-                license_headers = '&'.join(["{}={}".format(k, v) for k, v in license_headers.items()])
+                license_headers = '&'.join(["{}={}".format(k, v) for k, v in list(license_headers.items())])
             license_type = stream_data.get_value("stream", "keySystemOptions", 0, "name")
             license_key = "{0}|{1}|R{{SSM}}|".format(license_url, license_headers or "")
         else:
INFO: ./plugin.video.retrospect/resources/libs/textures/cached.py
--- ./plugin.video.retrospect/resources/libs/textures/cached.py	(original)
+++ ./plugin.video.retrospect/resources/libs/textures/cached.py	(refactored)
@@ -114,7 +114,7 @@
         textures_total = len(self.__textureQueue)
         textures_completed = 0
 
-        for uri, texture_path in self.__textureQueue.items():
+        for uri, texture_path in list(self.__textureQueue.items()):
             self._logger.debug("Fetching texture for '%s' to '%s'", uri, texture_path)
             if os.path.isfile(uri):
                 shutil.copyfile(uri, texture_path)
INFO: ./plugin.video.retrospect/resources/menus/menu_adaptive.py
--- ./plugin.video.retrospect/resources/menus @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Channel Favourites") as m:
     m.favourites()
INFO: ./plugin.video.retrospect/resources/menus/menu_channel_selection.py
--- ./plugin.video.retrospect/resources/menus/menu_channel_selection.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_channel_selection.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 # import sys
 # import xbmcgui
INFO: ./plugin.video.retrospect/resources/menus/menu_channelsettings.py
--- ./plugin.video.retrospect/resources/menus/menu_channelsettings.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_channelsettings.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Channel Settings") as m:
     m.channel_settings()
INFO: ./plugin.video.retrospect/resources/menus/menu_cloak.py
--- ./plugin.video.retrospect/resources/menus/menu_cloak.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_cloak.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Cloak Item") as m:
     m.toggle_cloak()
INFO: ./plugin.video.retrospect/resources/menus/menu_country_selection.py
--- ./plugin.video.retrospect/resources/menus/menu_country_selection.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_country_selection.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-Bmport menu
 
 with menu.Menu("Un-cloak Item") as m:
     m.toggle_cloak()
INFO: PO files are valid
ERROR: We found 1 problems and 1 warnings, please check the logfile.

@basrieter basrieter requested a review from enen92 October 9, 2019 19:21
@basrieter
Copy link
Contributor Author

Jenkins, I created PR xbmc/repo-resources#81 for the new resources

@enen92
Copy link
Member

enen92 commented Oct 9, 2019

@basrieter we don't use jenkins for repo-scripts and repo-plugins, but travis instead

@TravisBuddy
Copy link

Travis tests have failed

Hey @basrieter,
please read the following log in order to understand the failure reason. There might also be some helpful tips along the way.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

Expand here
INFO: Checking add-on plugin.video.retrospect
INFO: Created by Bas Rieter
INFO: Addon id matches folder name
INFO: Valid XML file found
ERROR: Version mismatch for required dependency resource.images.retrospect, required: 1.0.1, Available: 1.0.0
INFO: Image icon exists
INFO: Icon dimensions are fine 256x256
INFO: Image fanart exists
INFO: Fanart dimensions are fine 1920x1080
INFO: Image screenshot exists
INFO: Image screenshot exists
INFO: Image screenshot exists
WARN: Complex entry point. Check: default.py | Counted lines: 42 | Lines allowed: 15
INFO: ./plugin.video.retrospect/channels/channel.be/een/chn_een.py
--- ./plugin.video.retrospect/channels/channel.be/een/chn_een.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/een/chn_een.py	(refactored)
@@ -144,7 +144,7 @@
             400: "Karakters",
             413: "Het weer"
         }
-        if result_set["id"] in exclude.keys():
+        if result_set["id"] in list(exclude.keys()):
             return None
 
         # # dummy class
INFO: ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py
--- ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/rtbf/chn_rtbf.py	(refactored)
@@ -108,7 +108,7 @@
             "\a.: Cat&eacute;gories :.": "http://www.rtbf.be/news/api/menu?site=media"
         }
 
-        for k, v in sub_items.items():
+        for k, v in list(sub_items.items()):
             item = MediaItem(k, v)
             item.complete = True
             item.dontGroup = True
INFO: ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py
--- ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py	(original)
+++ ./plugin.video.retrospect/channels/channel.be/vrtnu/chn_vrtnu.py	(refactored)
@@ -323,7 +323,7 @@
 
         items = []
 
-        for name, meta in self.__channelData.items():
+        for name, meta in list(self.__channelData.items()):
             if "metaCode" not in meta:
                 continue
 
@@ -382,7 +382,7 @@
         """
 
         items = []
-        for key_value, stream_value in result_set.items():
+        for key_value, stream_value in list(result_set.items()):
             Logger.trace(stream_value)
             # noinspection PyArgumentList
             channel_data = self.__channelData.get(key_value, None)
INFO: ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py
--- ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py	(original)
+++ ./plugin.video.retrospect/channels/channel.de/srf/chn_srf.py	(refactored)
@@ -79,7 +79,7 @@
         live_channels = {"SRF 1 live": ("c4927fcf-e1a0-0001-7edd-1ef01d441651", "srf1.png"),
                          "SRF zwei live": ("c49c1d64-9f60-0001-1c36-43c288c01a10", "srf2.png"),
                          "SRF info live": ("c49c1d73-2f70-0001-138a-15e0c4ccd3d0", "srfinfo.png")}
-        for live_item in live_channels.keys():
+        for live_item in list(live_channels.keys()):
             item = MediaItem(live_item, live_base % (live_channels[live_item][0],))
             item.thumb = self.get_image_location(live_channels[live_item][1])
             item.icon = self.icon
INFO: ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py
--- ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nick/nickjr/chn_nickjr.py	(refactored)
@@ -106,7 +106,7 @@
 
         json = JsonHelper(json_data[0])
         result = []
-        for key, value in json.json.items():
+        for key, value in list(json.json.items()):
             result.append(value)
             value["title"] = key
 
INFO: ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py
--- ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py	(original)
+++ ./plugin.video.retrospect/channels/channel.no/nrkno/chn_nrkno.py	(refactored)
@@ -167,7 +167,7 @@
             "A - Å": "https://psapi.nrk.no/medium/tv/letters?apiKey={}".format(self.__api_key),
             "S&oslash;k": "#searchSite"
         }
-        for name, url in links.items():
+        for name, url in list(links.items()):
             item = MediaItem(name, url)
             item.icon = self.icon
             item.thumb = self.noImage
INFO: ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py
--- ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nos/nos2010/chn_nos2010.py	(refactored)
@@ -679,7 +679,7 @@
             return item
 
         images = result_set["images"]
-        for image_type, image_data in images.items():
+        for image_type, image_data in list(images.items()):
             if image_type == "original" and "tv" in image_data["formats"]:
                 item.fanart = image_data["formats"]["tv"]["source"]
             elif image_type == "grid.tile":
@@ -896,7 +896,7 @@
 
         images = result_set["images"]
         item.fanart = self.parentItem.fanart
-        for image_type, image_data in images.items():
+        for image_type, image_data in list(images.items()):
             if image_type == "original" and "original" in image_data["formats"]:
                 pass
                 # No fanart for now.
INFO: ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py
--- ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py	(original)
+++ ./plugin.video.retrospect/channels/channel.nos/nosnl/chn_nosnl.py	(refactored)
@@ -173,7 +173,7 @@
                 if image["width"] >= 720:
                     matched_image = image
                     break
-            item.thumb = matched_image["url"].values()[0]
+            item.thumb = list(matched_image["url"].values())[0]
 
         item.description = result_set["description"]
         item.complete = False
@@ -219,7 +219,7 @@
         part = item.create_new_empty_media_part()
         urls = []
         for stream in streams:
-            url = stream["url"].values()[-1]
+            url = list(stream["url"].values())[-1]
             if url in urls:
                 # duplicate url, ignore
                 continue
INFO: ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py
--- ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py	(original)
+++ ./plugin.video.retrospect/channels/channel.se/sbs/chn_sbs.py	(refactored)
@@ -602,10 +602,10 @@
 
     # noinspection PyTypeChecker
     def __update_image_lookup(self, json_data):
-        images = filter(lambda a: a["type"] == "image", json_data.get_value("included"))
+        images = [a for a in json_data.get_value("included") if a["type"] == "image"]
         images = {str(image["id"]): image["attributes"]["src"] for image in images}
 
-        shows = filter(lambda a: a["type"] == "show", json_data.get_value("included"))
+        shows = [a for a in json_data.get_value("included") if a["type"] == "show"]
         shows = {str(show["id"]): show["attributes"]["name"] for show in shows}
         self.showLookup.update(shows)
         self.imageLookup.update(images)
@@ -690,9 +690,7 @@
         # paid or not?
         if "contentPackages" in result_set["relationships"]:
             item.isPaid = not any(
-                filter(
-                    lambda p: p["id"].lower() == "free", result_set["relationships"]["contentPackages"]["data"]
-                )
+                [p for p in result_set["relationships"]["contentPackages"]["data"] if p["id"].lower() == "free"]
             )
         else:
             item.isPaid = False
INFO: ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py
--- ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py	(original)
+++ ./plugin.video.retrospect/channels/channel.se/svt/chn_svt.py	(refactored)
@@ -162,7 +162,7 @@
             LanguageHelper.get_localized_string(LanguageHelper.MostViewedEpisodes): "https://www.svtplay.se/populara?sida=1",
         }
 
-        for title, url in extra_items.items():
+        for title, url in list(extra_items.items()):
             new_item = MediaItem("\a.: %s :." % (title, ), url)
             new_item.complete = True
             new_item.thumb = self.noImage
@@ -222,7 +222,7 @@
         new_item.complete = True
         new_item.thumb = self.noImage
         new_item.dontGroup = True
-        for title, (url, thumb) in category_items.items():
+        for title, (url, thumb) in list(category_items.items()):
             cat_item = MediaItem(title, url)
             cat_item.complete = True
             cat_item.thumb = thumb or self.noImage
@@ -266,7 +266,7 @@
 
         data, items = self.__extract_json_data(data, "(?:__svtplay_apollo)")
         self.__apollo_data = JsonHelper(data).json
-        for k, v in self.__apollo_data.items():
+        for k, v in list(self.__apollo_data.items()):
             item = self.create_json_genre_item(v)
             if item:
                 items.append(item)
@@ -702,7 +702,7 @@
         json_data = JsonHelper(json_string)
         channels = json_data.get_value("channelsPage", "schedule")
         channel_list = []
-        for channel_name, channel_data in channels.items():
+        for channel_name, channel_data in list(channels.items()):
             if "channel" not in channel_data:
                 continue
             channel_list.append(channel_data)
@@ -873,7 +873,7 @@
             Logger.debug("Found video item for format: %s", video_format)
 
             url = video['url']
-            if any(filter(lambda s: s.Url == url, part.MediaStreams)):
+            if any([s for s in part.MediaStreams if s.Url == url]):
                 Logger.debug("Skippping duplicate Stream url: %s", url)
                 continue
 
INFO: ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py
--- ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py	(original)
+++ ./plugin.video.retrospect/channels/channel.uk/bbc/chn_bbc.py	(refactored)
@@ -477,7 +477,7 @@
         """
 
         items = []
-        for char, data in result_set.items():
+        for char, data in list(result_set.items()):
             shows = data.get("entities")
             if not shows:
                 continue
INFO: ./plugin.video.retrospect/resources/libs/addonsettings.py
--- ./plugin.video.retrospect/resources/libs/addonsettings.py	(original)
+++ ./plugin.video.retrospect/resources/libs/addonsettings.py	(refactored)
@@ -1280,7 +1280,7 @@
         for language in languages:
             language_lookup[language] = AddonSettings.__get_language_settings_id_and_label(language)
 
-        language_lookup_sorted_keys = sorted(language_lookup.keys(), key=lambda k: k or "")
+        language_lookup_sorted_keys = sorted(list(language_lookup.keys()), key=lambda k: k or "")
 
         for language in language_lookup_sorted_keys:
             channel_xml = '%s        <setting id="%s" type="bool" label="%s" subsetting="false" default="true" />\n' \
INFO: ./plugin.video.retrospect/resources/libs/chn_class.py
--- ./plugin.video.retrospect/resources/libs/chn_class.py	(original)
+++ ./plugin.video.retrospect/resources/libs/chn_class.py	(refactored)
@@ -897,14 +897,14 @@
         if url.startswith("#"):
             # let's handle the keyword url's
             Logger.trace("Found URL with labeled DataParser keyword [%s]", url)
-            if url in self.dataParsers.keys():
+            if url in list(self.dataParsers.keys()):
                 # use the parsers that is associated with No url (the None Parser)
                 data_parsers = self.dataParsers[url]
             else:
                 Logger.warning("no DataParser was found keyword [%s]. Continuing with other options.", url)
         else:
             # make sure we sort by keylength and then start with the longest one.
-            keys = sorted(self.dataParsers.keys(), key=len, reverse=True)
+            keys = sorted(list(self.dataParsers.keys()), key=len, reverse=True)
             # watch.lap("DataParsers sorted")
 
             # filter them in order
INFO: ./plugin.video.retrospect/resources/libs/mediaitem.py
--- ./plugin.video.retrospect/resources/libs/mediaitem.py	(original)
+++ ./plugin.video.retrospect/resources/libs/mediaitem.py	(refactored)
@@ -454,7 +454,7 @@
             stream_url = stream.Url
             if header_params:
                 kodi_query_string = reduce(
-                    lambda x, y: "%s&%s=%s" % (x, y, header_params[y]), header_params.keys(), "")
+                    lambda x, y: "%s&%s=%s" % (x, y, header_params[y]), list(header_params.keys()), "")
                 kodi_query_string = kodi_query_string.lstrip("&")
                 Logger.debug("Adding Kodi Stream parameters: %s\n%s", header_params, kodi_query_string)
                 stream_url = "%s|%s" % (stream.Url, kodi_query_string)
INFO: ./plugin.video.retrospect/resources/libs/paramparser.py
--- ./plugin.video.retrospect/resources/libs/paramparser.py	(original)
+++ ./plugin.video.retrospect/resources/libs/paramparser.py	(refactored)
@@ -116,7 +116,7 @@
             params[self.keywordCategory] = category
 
         url = "%s?" % (self.pluginName, )
-        for k in params.keys():
+        for k in list(params.keys()):
             url = "%s%s=%s&" % (url, k, params[k])
 
         url = url.strip('&')
INFO: ./plugin.video.retrospect/resources/libs/pickler.py
--- ./plugin.video.retrospect/resources/libs/pickler.py	(original)
+++ ./plugin.video.retrospect/resources/libs/pickler.py	(refactored)
@@ -49,7 +49,7 @@
 
         hex_string = hex_string.rstrip(' ')
         hex_string = reduce(lambda x, y: x.replace(y, Pickler.__Base64CharsDecoINFO: ./plugin.video.retrospect/resources/libs/urihandler.py
--- ./plugin.video.retrospect/resources/libs/urihandler.py	(original)
+++ ./plugin.video.retrospect/resources/libs/urihandler.py	(refactored)
@@ -227,7 +227,7 @@
             return None
 
         # do a startswith search
-        cookies = [c for c in cookies.values() if c.name.startswith(name)]
+        cookies = [c for c in list(cookies.values()) if c.name.startswith(name)]
         if not cookies:
             return None
         else:
@@ -522,7 +522,7 @@
     def __get_headers(self, referer, additional_headers):
         headers = {}
         if additional_headers:
-            for k, v in additional_headers.items():
+            for k, v in list(additional_headers.items()):
                 headers[k.lower()] = v
 
         if "user-agent" not in headers:
INFO: ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py
--- ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py	(original)
+++ ./plugin.video.retrospect/resources/libs/connectivity/cachehttpadapter.py	(refactored)
@@ -237,7 +237,7 @@
             "body": body_key,
             "url": res.url,
             "headers": dict(
-                (k, v) for k, v in res.headers.items()
+                (k, v) for k, v in list(res.headers.items())
             ),
             "status": res.status_code,
             "reason": res.reason,
INFO: ./plugin.video.retrospect/resources/libs/streams/adaptive.py
--- ./plugin.video.retrospect/resources/libs/streams/adaptive.py	(original)
+++ ./plugin.video.retrospect/resources/libs/streams/adaptive.py	(refactored)
@@ -36,7 +36,7 @@
 
         header = ""
         if key_headers:
-            for k, v in key_headers.items():
+            for k, v in list(key_headers.items()):
                 header = "{0}&{1}={2}".format(header, k, HtmlEntityHelper.url_encode(v))
 
         if key_type in ("A", "R", "B"):
@@ -108,7 +108,7 @@
 
         if headers:
             header = ""
-            for k, v in headers.items():
+            for k, v in list(headers.items()):
                 header = "{0}&{1}={2}".format(header, k, HtmlEntityHelper.url_encode(v))
             strm.add_property("inputstream.adaptive.stream_headers", header.strip("&"))
 
INFO: ./plugin.video.retrospect/resources/libs/streams/npostream.py
--- ./plugin.video.retrospect/resources/libs/streams/npostream.py	(original)
+++ ./plugin.video.retrospect/resources/libs/streams/npostream.py	(refactored)
@@ -101,7 +101,7 @@
             Logger.info("Using encrypted Dash for NPO")
             license_headers = stream_data.get_value("stream", "keySystemOptions", 0, "options", "httpRequestHeaders")
             if license_headers:
-                license_headers = '&'.join(["{}={}".format(k, v) for k, v in license_headers.items()])
+                license_headers = '&'.join(["{}={}".format(k, v) for k, v in list(license_headers.items())])
             license_type = stream_data.get_value("stream", "keySystemOptions", 0, "name")
             license_key = "{0}|{1}|R{{SSM}}|".format(license_url, license_headers or "")
         else:
INFO: ./plugin.video.retrospect/resources/libs/textures/cached.py
--- ./plugin.video.retrospect/resources/libs/textures/cached.py	(original)
+++ ./plugin.video.retrospect/resources/libs/textures/cached.py	(refactored)
@@ -114,7 +114,7 @@
         textures_total = len(self.__textureQueue)
         textures_completed = 0
 
-        for uri, texture_path in self.__textureQueue.items():
+        for uri, texture_path in list(self.__textureQueue.items()):
             self._logger.debug("Fetching texture for '%s' to '%s'", uri, texture_path)
             if os.path.isfile(uri):
                 shutil.copyfile(uri, texture_path)
INFO: ./plugin.video.retrospect/resources/menus/menu_adaptive.py
--- ./plugin.video.retrospect/resources/menus/menu_adaptive.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_adaptive.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 # Debug code
 # import sys
INFO: ./plugin.video.retrospect/resources/menus/menu_add_fav.py
--- ./plugin.video.retrospect/resources/menus/menu_add_fav.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_add_fav.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Add Favourite") as m:
     m.add_favourite()
INFO: ./plugin.video.retrospect/resources/menus/menu_all_favs.py
--- ./plugin.video.retrospect/resources/menus/menu_all_favs.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_all_favs.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("All Favourites") as m:
     m.favourites(all_favorites=True)
INFO: ./plugin.video.retrospect/resources/menus/menu_bitrate.py
--- ./plugin.video.retrospect/resources/menus/menu_bitrate.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_bitrate.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 # import sys
 # import xbmcgui
INFO: ./plugin.video.retrospect/resources/menus/menu_channel_favs.py
--- ./plugin.video.retrospect/resources/menus/menu_channel_favs.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_channel_favs.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Channel Favourites") as m:
     m.favourites()
INFO: ./plugin.video.retrospect/resources/menus/menu_channel_selection.py
--- ./plugin.video.retrospect/resources/menus/menu_channel_selection.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_channel_selection.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 # import sys
 # import xbmcgui
INFO: ./plugin.video.retrospect/resources/menus/menu_channelsettings.py
--- ./plugin.video.retrospect/resources/menus/menu_channelsettings.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_channelsettings.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Channel Settings") as m:
     m.channel_settings()
INFO: ./plugin.video.retrospect/resources/menus/menu_cloak.py
--- ./plugin.video.retrospect/resources/menus/menu_cloak.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_cloak.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Cloak Item") as m:
     m.toggle_cloak()
INFO: ./plugin.video.retrospect/resources/menus/menu_country_selection.py
--- ./plugin.video.retrospect/resources/menus/menu_country_selection.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_country_selection.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Country Selection") as c:
     c.show_country_settings()
INFO: ./plugin.video.retrospect/resources/menus/menu_hide_channel.py
--- ./plugin.video.retrospect/resources/menus/menu_hide_channel.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_hide_channel.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Hide Channel") as m:
     m.hide_channel()
INFO: ./plugin.video.retrospect/resources/menus/menu_remove_fav.py
--- ./plugin.video.retrospect/resources/menus/menu_remove_fav.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_remove_fav.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Remove Favourite") as m:
     m.remove_favourite()
INFO: ./plugin.video.retrospect/resources/menus/menu_settings.py
--- ./plugin.video.retrospect/resources/menus/menu_settings.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_settings.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Show Add-on Settings") as m:
     m.show_settings()
INFO: ./plugin.video.retrospect/resources/menus/menu_uncloak.py
--- ./plugin.video.retrospect/resources/menus/menu_uncloak.py	(original)
+++ ./plugin.video.retrospect/resources/menus/menu_uncloak.py	(refactored)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: CC-BY-NC-SA-4.0
 
-import menu
+from . import menu
 
 with menu.Menu("Un-cloak Item") as m:
     m.toggle_cloak()
INFO: PO files are valid
ERROR: We found 1 problems and 1 warnings, please check the logfile.

@enen92
Copy link
Member

enen92 commented Oct 9, 2019

LGMT. However it can only be merged once the repo syncs. Looks like we still need to wait a bit for the new version of the resource.addon to be available.

@basrieter
Copy link
Contributor Author

I keep mixing them up @enen92

Let's wait for the repo's to sync.

@TravisBuddy

This comment has been minimized.

@TravisBuddy

This comment has been minimized.

@TravisBuddy
Copy link

Travis tests were successful

Hey @basrieter,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@enen92 enen92 merged commit dbc191e into xbmc:leia Oct 10, 2019
tingjhenjiang pushed a commit to tingjhenjiang/plugin.video.hamivideo that referenced this pull request Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants