Compare commits
No commits in common. "24357767964c564463dc353ba969c2f02059c217" and "14c3e2a76c6cb40ebb8b40b25e45a1721b77be8c" have entirely different histories.
2435776796
...
14c3e2a76c
@ -5,7 +5,8 @@ from progress.bar import IncrementalBar
|
|||||||
|
|
||||||
|
|
||||||
def get_hidden_themes(imdb_ids):
|
def get_hidden_themes(imdb_ids):
|
||||||
film_keywords = []
|
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:
|
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:
|
for imdb_id in imdb_ids:
|
||||||
@ -13,12 +14,14 @@ def get_hidden_themes(imdb_ids):
|
|||||||
|
|
||||||
if 'keywords' in movie_data:
|
if 'keywords' in movie_data:
|
||||||
keywords = set(movie_data['keywords'])
|
keywords = set(movie_data['keywords'])
|
||||||
film_keywords.append(keywords)
|
if is_first:
|
||||||
|
hidden_themes = keywords
|
||||||
|
is_first = False
|
||||||
|
else:
|
||||||
|
hidden_themes = hidden_themes.intersection(keywords)
|
||||||
|
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
hidden_themes = set.intersection(*film_keywords)
|
|
||||||
|
|
||||||
return hidden_themes
|
return hidden_themes
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ def build_page(keyword_data, minimum_score=1.0):
|
|||||||
row_data = []
|
row_data = []
|
||||||
row_data.append(str(keyword))
|
row_data.append(str(keyword))
|
||||||
row_data.append(str(len(data['vcinema_films'])))
|
row_data.append(str(len(data['vcinema_films'])))
|
||||||
row_data.append(str(data['total']))
|
row_data.append(str(len(data['total'])))
|
||||||
row_data.append(str(round(data['score'], 3)))
|
row_data.append(str(round(data['score'], 3)))
|
||||||
table += " | ".join(row_data)
|
table += " | ".join(row_data)
|
||||||
|
|
||||||
|
@ -100,12 +100,12 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument('token_id', help='API token ID.')
|
parser.add_argument('token_id', help='API token ID.')
|
||||||
parser.add_argument('token_secret', help='API token secret.')
|
parser.add_argument('token_secret', help='API token secret.')
|
||||||
|
|
||||||
parser.add_argument('--update_csv', help='Update viewings.csv file, default: True', default=True, required=False)
|
parser.add_argument('-update_csv', help='Update viewings.csv file, default: True', default=False)
|
||||||
parser.add_argument('--update_films_by_year', help='Update films by release year page, default: True', default=True, required=False)
|
parser.add_argument('--update_films_by_year', help='Update films by release year page, default: True', default=False, required=False)
|
||||||
parser.add_argument('--update_films_by_country', help='Update films by country page, default: True', default=True, required=False)
|
parser.add_argument('--update_films_by_country', help='Update films by country page, default: True', default=True, required=False)
|
||||||
parser.add_argument('--update_films_by_reference', help='Update films by reference page, default: True', default=True, required=False)
|
parser.add_argument('--update_films_by_reference', help='Update films by reference page, default: True', default=False, required=False)
|
||||||
parser.add_argument('--update_hidden_themes', help='Update hidden themes page, default: True', default=True, required=False)
|
parser.add_argument('--update_hidden_themes', help='Update hidden themese page, default: True', default=False, required=False)
|
||||||
parser.add_argument('--update_keyword_scores', help='Update keyword scores page - THIS TAKES A WHILE, default: False', default=False, required=False)
|
parser.add_argument('--update_keyword_scores', help='Upate keyword scores page - THIS TAKES A WHILE, default: False', default=False, required=False)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user