def movieLoad(self, movieid):
     """
     動画を保存
     save videos
     """
     if not self.db.addMovie(movieid):  # DB登録
         # 登録済みの時
         self.db.setMovieState(movieid, 0)
     api = NicovideoAPI(movie_id=movieid)
     title = api.get_movie_title()
     # ext = api.get_movie_type()
     nicoid = self.db.getNicoid()
     nicopw = self.db.getNicopw()
     savedir = getSavedir()
     self.status.chLoadingMovie()
     self.db.setMovieTitle(movieid, title)
     self.db.setMovieDescription(movieid, api.get_movie_description())
     self.db.setMovieLength(movieid, api.get_movie_length())
     self.db.setMoviePath(movieid, moviePath)
     self.status.setLoadingMovieid(movieid)
     moviePath = api.save_movie(nicoid, nicopw, savedir)
     self.db.setMovieThumbnail(movieid, api.save_thumbnail(savedir))
     self.db.setMovieComment(movieid, api.save_comment(nicoid, nicopw, savedir, title))
     self.db.setMovieState(movieid, 1)
     self.movieLoadDone()
     return True
Example #2
0
 def movieLoad(self, movieid):
     """
     動画を保存
     save videos
     """
     if self.db.extMovieidInTable(movieid):
         # already resists
         self.db.setMovieState(movieid, 0)
     else:
         self.db.addMovie(movieid)  # resists for database
     api = NicovideoAPI(movie_id=movieid)
     title = api.get_movie_title()
     # ext = api.get_movie_type()
     nicoid = self.db.getNicoid()
     nicopw = self.db.getNicopw()
     savedir = getSavedir()
     self.__loading = True
     self.status.chLoadingMovie(self.__loading)
     self.db.setMovieTitle(movieid, title)
     self.db.setMovieDescription(movieid, api.get_movie_description())
     self.db.setMovieLength(movieid, api.get_movie_length())
     self.status.setLoadingMovieid(movieid)
     moviePath = api.save_movie(nicoid, nicopw, savedir)
     self.db.setMoviePath(movieid, moviePath)
     self.db.setMovieThumbnail(movieid, api.save_thumbnail(savedir))
     self.db.setMovieComment(movieid, api.save_comment(nicoid, nicopw, savedir, title))
     self.db.setMovieState(movieid, 1)
     self.movieLoadDone()
     return True