Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def get_video_info(video_id):
|
|
| 110 |
video_info = {
|
| 111 |
'title': response['items'][0]['snippet']['title'],
|
| 112 |
'channel_title': response['items'][0]['snippet']['channelTitle'],
|
| 113 |
-
'category': response['items'][0]['snippet']['categoryId'],
|
| 114 |
'tags': '|'.join(response['items'][0]['snippet'].get('tags', [])),
|
| 115 |
'views': response['items'][0]['statistics']['viewCount'],
|
| 116 |
'likes': response['items'][0]['statistics'].get('likeCount', 0),
|
|
@@ -141,6 +141,39 @@ st.markdown("### Generate comments using video metadata!")
|
|
| 141 |
|
| 142 |
st.image(Image.open("clown.jpg"), width=400)
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
tokenizer, model = load_model()
|
| 145 |
|
| 146 |
link = st.text_input("Enter YouTube Link", placeholder="Paste URL here...")
|
|
|
|
| 110 |
video_info = {
|
| 111 |
'title': response['items'][0]['snippet']['title'],
|
| 112 |
'channel_title': response['items'][0]['snippet']['channelTitle'],
|
| 113 |
+
'category': category_dict.get(int(response['items'][0]['snippet']['categoryId']), "Unknown category"),
|
| 114 |
'tags': '|'.join(response['items'][0]['snippet'].get('tags', [])),
|
| 115 |
'views': response['items'][0]['statistics']['viewCount'],
|
| 116 |
'likes': response['items'][0]['statistics'].get('likeCount', 0),
|
|
|
|
| 141 |
|
| 142 |
st.image(Image.open("clown.jpg"), width=400)
|
| 143 |
|
| 144 |
+
category_dict = {1: 'Film & Animation',
|
| 145 |
+
2: 'Autos & Vehicles',
|
| 146 |
+
10: 'Music',
|
| 147 |
+
15: 'Pets & Animals',
|
| 148 |
+
17: 'Sports',
|
| 149 |
+
18: 'Short Movies',
|
| 150 |
+
19: 'Travel & Events',
|
| 151 |
+
20: 'Gaming',
|
| 152 |
+
21: 'Videoblogging',
|
| 153 |
+
22: 'People & Blogs',
|
| 154 |
+
23: 'Comedy',
|
| 155 |
+
24: 'Entertainment',
|
| 156 |
+
25: 'News & Politics',
|
| 157 |
+
26: 'Howto & Style',
|
| 158 |
+
27: 'Education',
|
| 159 |
+
28: 'Science & Technology',
|
| 160 |
+
29: 'Nonprofits & Activism',
|
| 161 |
+
30: 'Movies',
|
| 162 |
+
31: 'Anime/Animation',
|
| 163 |
+
32: 'Action/Adventure',
|
| 164 |
+
33: 'Classics',
|
| 165 |
+
34: 'Comedy',
|
| 166 |
+
35: 'Documentary',
|
| 167 |
+
36: 'Drama',
|
| 168 |
+
37: 'Family',
|
| 169 |
+
38: 'Foreign',
|
| 170 |
+
39: 'Horror',
|
| 171 |
+
40: 'Sci-Fi/Fantasy',
|
| 172 |
+
41: 'Thriller',
|
| 173 |
+
42: 'Shorts',
|
| 174 |
+
43: 'Shows',
|
| 175 |
+
44: 'Trailers'}
|
| 176 |
+
|
| 177 |
tokenizer, model = load_model()
|
| 178 |
|
| 179 |
link = st.text_input("Enter YouTube Link", placeholder="Paste URL here...")
|