@set_database
def get_download_youtube_ids(paths=None, downloaded=False, **kwargs):
 if paths:
  youtube_ids = dict()
  for path in paths:
   selector = (((Item.kind != 'Topic') & Item.path.contains(path)) & Item.youtube_id.is_null(False))
   if downloaded:
    selector &= (Item.files_complete > 0)
   else:
    selector &= (Item.files_complete == 0)
   youtube_ids.update(dict([item for item in Item.select(Item.youtube_id, Item.title).where(selector).tuples() if item[0]]))
  return youtube_ids

@ set_database def get_download_youtube_ids ( paths = None , downloaded = False , ** kwargs ) : if paths : youtube_ids = dict ( ) for path in paths : selector = ( ( ( Item . kind != 'Topic' ) & Item . path . contains ( path ) ) & Item . youtube_id . is_null ( False ) ) if downloaded : selector &= ( Item . files_complete > 0 ) else : selector &= ( Item . files_complete == 0 ) youtube_ids . update ( dict ( [ item for item in Item . select ( Item . youtube_id , Item . title ) . where ( selector ) . tuples ( ) if item [ 0 ] ] ) ) return youtube_ids
convenience function for taking a list of content ids and returning all associated youtube_ids for downloads .