Explorar el Código

add missing parameters for the ParseAPIData function which led to errors while adding channels

Helmut Pozimski hace 9 años
padre
commit
c62eea912d
Se han modificado 2 ficheros con 7 adiciones y 6 borrados
  1. 5 4
      lib_stov/noapi.py
  2. 2 2
      lib_stov/subscription.py

+ 5 - 4
lib_stov/noapi.py

@@ -100,10 +100,11 @@ class Connector(object):
         if len(video_ids) >= 1:
             for video_id in video_ids.split("\n"):
                 video_exists = False
-                for existing_video in existing_videos:
-                    if video_id == existing_video.ytid:
-                        video_exists = True
-                        break
+                if existing_videos:
+                    for existing_video in existing_videos:
+                        if video_id == existing_video.ytid:
+                            video_exists = True
+                            break
                 if not video_exists:
                     try:
                         video_title = subprocess.check_output([

+ 2 - 2
lib_stov/subscription.py

@@ -119,7 +119,7 @@ class sub(object):
 
     def AddSub(self):
         """Adds a new subscription to the database"""
-        parsed_response = self._connector.ParseAPIData()
+        parsed_response = self._connector.ParseAPIData([])
         self.__title = parsed_response.title
         self.__directory = self.__name + "_" + self.__search.replace(" ", "_")
         data = (self.__title, self.__type, self.__search, self.__directory,
@@ -131,7 +131,7 @@ class sub(object):
         deletes it if it doesn't
 
         """
-        parsed_response = self._connector.ParseAPIData()
+        parsed_response = self._connector.ParseAPIData([])
         self.GatherVideos(videos)
         for entry in parsed_response.videos:
             self.__id_list.append(entry.ytid)