Example #1
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
 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 #3
0
 def load(self, movieid):
     """
     load movieid
     """
     movieid = movieid
     self.logging("load: %s" % movieid)
     # 各データの取得
     db = Database(self.databasePath)
     sdb = SystemDatabase(self.systemDatabasePath)
     nicoid = sdb.getNicoid()
     nicopw = sdb.getNicopw()
     savedir = sdb.getSavedir()
     sdb.close()
     api = NicovideoAPI(movie_id=movieid)
     title = api.get_movie_title()
     moviePath = api.save_movie(nicoid, nicopw, savedir)  # 保存専用のクラスを定義する。一時停止可能なもの
     # 登録
     db.setMoviePath(movieid, moviePath)
     db.setMovieState(movieid, 1)
     self.queue.done()
     db.close()
     return True