Compare commits
No commits in common. "52fc8638a0e445b481f91aa890dcee81b00aa298" and "40fd1605166f0ac95e48a34754ddf695d5d784d7" have entirely different histories.
52fc8638a0
...
40fd160516
@ -1,37 +0,0 @@
|
|||||||
from imdb_utils import IMDbUtils
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
from progress.bar import IncrementalBar
|
|
||||||
|
|
||||||
|
|
||||||
def get_hidden_themes(imdb_ids):
|
|
||||||
hidden_themes = set()
|
|
||||||
is_first = True
|
|
||||||
|
|
||||||
with IncrementalBar('Retrieving movie data', max=len(imdb_ids), suffix='%(percent).1f%% - %(eta)ds remaining', check_tty=False) as bar:
|
|
||||||
for imdb_id in imdb_ids:
|
|
||||||
movie_data = IMDbUtils.get_movie_keywords(imdb_id)
|
|
||||||
|
|
||||||
if 'keywords' in movie_data:
|
|
||||||
keywords = set(movie_data['keywords'])
|
|
||||||
if is_first:
|
|
||||||
hidden_themes = keywords
|
|
||||||
is_first = False
|
|
||||||
else:
|
|
||||||
hidden_themes = hidden_themes.intersection(keywords)
|
|
||||||
|
|
||||||
bar.next()
|
|
||||||
|
|
||||||
return hidden_themes
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument('imdb_ids', nargs="+", default=[])
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
hidden_themes = get_hidden_themes(args.imdb_ids)
|
|
||||||
|
|
||||||
print(hidden_themes)
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user