1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
|
diff --git a/settings.py b/settings.py
index f0c297a..80ce7d7 100644
--- a/settings.py
+++ b/settings.py
@@ -462,6 +462,6 @@ def settings_page():
for func, old_value, value in to_call:
func(old_value, value)
- return flask.redirect(util.URL_ORIGIN + '/settings', 303)
+ return flask.redirect(util.URL_ORIGIN)
else:
flask.abort(400)
diff --git a/youtube/__init__.py b/youtube/__init__.py
index 08f4f6f..069775c 100644
--- a/youtube/__init__.py
+++ b/youtube/__init__.py
@@ -13,9 +13,6 @@ yt_app.url_map.strict_slashes = False
# yt_app.jinja_env.lstrip_blocks = True
-yt_app.add_url_rule('/settings', 'settings_page', settings.settings_page, methods=['POST', 'GET'])
-
-
@yt_app.route('/')
def homepage():
return flask.render_template('home.html', title="YT Local")
diff --git a/youtube/static/channel.css b/youtube/static/channel.css
index c8750da..b0f249e 100644
--- a/youtube/static/channel.css
+++ b/youtube/static/channel.css
@@ -264,11 +264,9 @@ hr {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/static/local_playlist.css b/youtube/static/local_playlist.css
index 3b32f0b..e5554dc 100644
--- a/youtube/static/local_playlist.css
+++ b/youtube/static/local_playlist.css
@@ -240,11 +240,9 @@ hr {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/static/playlist.css b/youtube/static/playlist.css
index 4bde3b5..e13b61b 100644
--- a/youtube/static/playlist.css
+++ b/youtube/static/playlist.css
@@ -250,11 +250,9 @@ hr {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/static/search.css b/youtube/static/search.css
index da622fa..3f6aff5 100644
--- a/youtube/static/search.css
+++ b/youtube/static/search.css
@@ -268,11 +268,9 @@ hr {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/static/subscription.css b/youtube/static/subscription.css
index c163d9e..d2b589c 100644
--- a/youtube/static/subscription.css
+++ b/youtube/static/subscription.css
@@ -244,11 +244,9 @@ hr {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/static/watch.css b/youtube/static/watch.css
index 116dbae..6e4e645 100644
--- a/youtube/static/watch.css
+++ b/youtube/static/watch.css
@@ -407,11 +407,9 @@ label[for=options-toggle-cbox] {
.item-box {
display: grid;
- grid-template-columns: 1.9fr 0.1fr;
+ grid-template-columns: 1fr;
grid-template-rows: 1fr;
- grid-gap: 1px;
- grid-template-areas:
- "item-video item-checkbox";
+ grid-template-areas: "item-video";
}
.item-video {
diff --git a/youtube/templates/base.html b/youtube/templates/base.html
index 3a5d9d0..971f0c8 100644
--- a/youtube/templates/base.html
+++ b/youtube/templates/base.html
@@ -118,22 +118,6 @@
</div>
</form>
- {% if header_playlist_names is defined %}
- <form class="playlist" id="playlist-edit" action="/youtube.com/edit_playlist" method="post" target="_self">
- <input class="play-box" name="playlist_name" id="playlist-name-selection" list="playlist-options" type="search" placeholder="I added your playlist...">
- <datalist class="play-hidden" id="playlist-options">
- {% for playlist_name in header_playlist_names %}
- <option value="{{ playlist_name }}">{{ playlist_name }}</option>
- {% endfor %}
- </datalist>
- <button class="play-add" type="submit" id="playlist-add-button" name="action" value="add">+List</button>
- <div class="play-clean">
- <button type="reset" id="item-selection-reset">Clear selection</button>
- </div>
- </form>
- <script src="/youtube.com/static/js/playlistadd.js"></script>
- {% endif %}
-
</header>
<main class="main">
diff --git a/youtube/templates/channel.html b/youtube/templates/channel.html
index 294f1df..a4361c3 100644
--- a/youtube/templates/channel.html
+++ b/youtube/templates/channel.html
@@ -21,14 +21,6 @@
<div class="summary">
<p>{{ short_description }}</p>
</div>
- <div class="subscribe">
- <form method="POST" action="/youtube.com/subscriptions" class="subscribe-unsubscribe">
- <input class="btn-subscribe" type="submit" value="{{ 'Unsubscribe' if subscribed else 'Subscribe' }}">
- <input type="hidden" name="channel_id" value="{{ channel_id }}">
- <input type="hidden" name="channel_name" value="{{ channel_name }}">
- <input type="hidden" name="action" value="{{ 'unsubscribe' if subscribed else 'subscribe' }}">
- </form>
- </div>
</div>
<hr/>
diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html
index 94554d4..7ba904a 100644
--- a/youtube/templates/common_elements.html
+++ b/youtube/templates/common_elements.html
@@ -59,9 +59,6 @@
{% endif %}
</div>
</div>
- {% if info['type'] == 'video' %}
- <input class="item-checkbox" type="checkbox" name="video_info_list" value="{{ info['video_info'] }}" form="playlist-edit">
- {% endif %}
{% endif %}
</article>
{% endmacro %}
diff --git a/youtube/templates/home.html b/youtube/templates/home.html
index ef1f029..b537cca 100644
--- a/youtube/templates/home.html
+++ b/youtube/templates/home.html
@@ -4,10 +4,4 @@
<link href="/youtube.com/static/home.css" rel="stylesheet"/>
{% endblock style %}
{% block main %}
- <ul>
- <li><a href="/youtube.com/playlists">Local playlists</a></li>
- <li><a href="/youtube.com/subscriptions">Subscriptions</a></li>
- <li><a href="/youtube.com/subscription_manager">Subscription Manager</a></li>
- <li><a href="/youtube.com/settings">Settings</a></li>
- </ul>
{% endblock main %}
diff --git a/youtube/templates/settings.html b/youtube/templates/settings.html
index 7a7ce9e..4749d4c 100644
--- a/youtube/templates/settings.html
+++ b/youtube/templates/settings.html
@@ -5,43 +5,5 @@
{% endblock style %}
{% block main %}
- <form method="POST" class="settings-form">
- {% for categ in categories %}
- <h2>{{ categ|capitalize }}</h2>
- <ul class="settings-list">
- {% for setting_name, setting_info, value in settings_by_category[categ] %}
- {% if not setting_info.get('hidden', false) %}
- <li class="setting-item">
- {% if 'label' is in(setting_info) %}
- <label for="{{ 'setting_' + setting_name }}">{{ setting_info['label'] }}</label>
- {% else %}
- <label for="{{ 'setting_' + setting_name }}">{{ setting_name.replace('_', ' ')|capitalize }}</label>
- {% endif %}
- {% if setting_info['type'].__name__ == 'bool' %}
- <input type="checkbox" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" {{ 'checked' if value else '' }}>
- {% elif setting_info['type'].__name__ == 'int' %}
- {% if 'options' is in(setting_info) %}
- <select id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}">
- {% for option in setting_info['options'] %}
- <option value="{{ option[0] }}" {{ 'selected' if option[0] == value else '' }}>{{ option[1] }}</option>
- {% endfor %}
- </select>
- {% else %}
- <input type="number" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}" step="1">
- {% endif %}
- {% elif setting_info['type'].__name__ == 'float' %}
-
- {% elif setting_info['type'].__name__ == 'str' %}
- <input type="text" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}">
- {% else %}
- <span>Error: Unknown setting type: setting_info['type'].__name__</span>
- {% endif %}
- </li>
- {% endif %}
- {% endfor %}
- </ul>
- {% endfor %}
- <input type="submit" value="Save settings">
- </form>
{% endblock main %}
diff --git a/youtube/templates/subscription_manager.html b/youtube/templates/subscription_manager.html
deleted file mode 100644
index 62a8bed..0000000
--- a/youtube/templates/subscription_manager.html
+++ /dev/null
@@ -1,77 +0,0 @@
-{% set page_title = 'Subscription Manager' %}
-{% extends "base.html" %}
-{% block style %}
- <link href="/youtube.com/static/subscription_manager.css" rel="stylesheet"/>
-{% endblock style %}
-
-
-{% macro subscription_list(sub_list) %}
- {% for subscription in sub_list %}
- <li class="sub-list-item {{ 'muted' if subscription['muted'] else '' }}">
- <input class="sub-list-checkbox" name="channel_ids" value="{{ subscription['channel_id'] }}" form="subscription-manager-form" type="checkbox">
- <a href="{{ subscription['channel_url'] }}" class="sub-list-item-name" title="{{ subscription['channel_name'] }}">{{ subscription['channel_name'] }}</a>
- <span class="tag-list">{{ ', '.join(subscription['tags']) }}</span>
- </li>
- {% endfor %}
-{% endmacro %}
-
-{% block main %}
- <div class="import-export">
- <form class="subscriptions-import-form" enctype="multipart/form-data" action="/youtube.com/import_subscriptions" method="POST">
- <h2>Import subscriptions</h2>
- <div class="subscriptions-import-options">
- <input type="file" id="subscriptions-import" accept="application/json, application/xml, text/x-opml" name="subscriptions_file">
- <input type="submit" value="Import">
- </div>
- </form>
-
- <form class="subscriptions-export-form" action="/youtube.com/export_subscriptions" method="POST">
- <h2>Export subscriptions</h2>
- <div class="subscriptions-export-options">
- <select id="export-type" name="export_format" title="Export format">
- <option value="json">JSON</option>
- <option value="opml">OPML (RSS, no tags)</option>
- </select>
- <label for="include-muted">Include muted</label>
- <input id="include-muted" type="checkbox" name="include_muted" checked>
- <input type="submit" value="Export">
- </div>
- </form>
- </div>
-
- <hr>
-
- <form id="subscription-manager-form" class="sub-list-controls" method="POST">
- {% if group_by_tags %}
- <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=0">Don't group</a>
- {% else %}
- <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=1">Group by tags</a>
- {% endif %}
- <input type="text" name="tags">
- <button type="submit" name="action" value="add_tags">Add tags</button>
- <button type="submit" name="action" value="remove_tags">Remove tags</button>
- <button type="submit" name="action" value="unsubscribe_verify">Unsubscribe</button>
- <button type="submit" name="action" value="mute">Mute</button>
- <button type="submit" name="action" value="unmute">Unmute</button>
- <input type="reset" value="Clear Selection">
- </form>
-
-
- {% if group_by_tags %}
- <ul class="tag-group-list">
- {% for tag_name, sub_list in tag_groups %}
- <li class="tag-group">
- <h2 class="tag-group-name">{{ tag_name }}</h2>
- <ol class="sub-list">
- {{ subscription_list(sub_list) }}
- </ol>
- </li>
- {% endfor %}
- </ul>
- {% else %}
- <ol class="sub-list">
- {{ subscription_list(sub_list) }}
- </ol>
- {% endif %}
-
-{% endblock main %}
diff --git a/youtube/templates/subscriptions.html b/youtube/templates/subscriptions.html
index b528e5c..6302fcc 100644
--- a/youtube/templates/subscriptions.html
+++ b/youtube/templates/subscriptions.html
@@ -13,71 +13,5 @@
{% block main %}
- <div class="subscriptions-sidebar">
- <div class="sidebar-links">
- <a class="sidebar-title" href="/youtube.com/subscription_manager" class="sub-manager-link">Subscription Manager</a>
- <form class="sidebar-action" method="POST" class="refresh-all">
- <input type="submit" value="Check All">
- <input type="hidden" name="action" value="refresh">
- <input type="hidden" name="type" value="all">
- </form>
- </div>
-
- <ol class="sidebar-list tags">
- {% if current_tag %}
- <li class="sidebar-list-item">
- <a href="/youtube.com/subscriptions" class="sidebar-item-name">Any tag</a>
- </li>
- {% endif %}
-
- {% for tag in tags %}
- <li class="sidebar-list-item">
- {% if tag == current_tag %}
- <span class="sidebar-item-name">{{ tag }}</span>
- {% else %}
- <a href="?tag={{ tag|urlencode }}" class="sidebar-item-name">{{ tag }}</a>
- {% endif %}
- <form method="POST" class="sidebar-item-refresh">
- <input type="submit" value="Check">
- <input type="hidden" name="action" value="refresh">
- <input type="hidden" name="type" value="tag">
- <input type="hidden" name="tag_name" value="{{ tag }}">
- </form>
- </li>
- {% endfor %}
- </ol>
-
- <hr>
- <ol class="sidebar-list sub-refresh-list">
- {% for subscription in subscription_list %}
- <li class="sidebar-list-item {{ 'muted' if subscription['muted'] else '' }}">
- <a href="{{ subscription['channel_url'] }}" class="sidebar-item-name" title="{{ subscription['channel_name'] }}">{{ subscription['channel_name'] }}</a>
- <form method="POST" class="sidebar-item-refresh">
- <input type="submit" value="Check">
- <input type="hidden" name="action" value="refresh">
- <input type="hidden" name="type" value="channel">
- <input type="hidden" name="channel_id" value="{{ subscription['channel_id'] }}">
- </form>
- </li>
- {% endfor %}
- </ol>
- </div>
-
- {% if current_tag %}
- <h2 class="current-tag">{{ current_tag }}</h2>
- {% endif %}
-
- <div class="video-container">
- {% for video_info in videos %}
- {{ common_elements.item(video_info) }}
- {% endfor %}
- </div>
- <hr/>
-
- <footer class="pagination-container">
- <nav class="pagination-list">
- {{ common_elements.page_buttons(num_pages, '/youtube.com/subscriptions', parameters_dictionary) }}
- </nav>
- </footer>
{% endblock main %}
|