Spaces:
Paused
Paused
Commit
·
e4f04cc
1
Parent(s):
b8f7a78
fix
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ CACHE_DIR = os.getenv("CACHE_DIR")
|
|
19 |
if not os.path.exists(CACHE_DIR):
|
20 |
os.makedirs(CACHE_DIR)
|
21 |
|
22 |
-
indexer()
|
23 |
|
24 |
if not os.path.exists(INDEX_FILE):
|
25 |
raise FileNotFoundError(f"{INDEX_FILE} not found. Please make sure the file exists.")
|
@@ -212,7 +212,10 @@ def film_player(title):
|
|
212 |
if not os.path.exists(cached_file_path):
|
213 |
return jsonify({'error': 'Film not cached'}), 404
|
214 |
|
215 |
-
|
|
|
|
|
|
|
216 |
|
217 |
@app.route('/cached_films/<path:title>')
|
218 |
def serve_cached_film(title):
|
|
|
19 |
if not os.path.exists(CACHE_DIR):
|
20 |
os.makedirs(CACHE_DIR)
|
21 |
|
22 |
+
indexer()
|
23 |
|
24 |
if not os.path.exists(INDEX_FILE):
|
25 |
raise FileNotFoundError(f"{INDEX_FILE} not found. Please make sure the file exists.")
|
|
|
212 |
if not os.path.exists(cached_file_path):
|
213 |
return jsonify({'error': 'Film not cached'}), 404
|
214 |
|
215 |
+
# Provide the URL to the cached file
|
216 |
+
cached_url = f"/cached_films/{urllib.parse.quote(title)}"
|
217 |
+
|
218 |
+
return render_template('film_player.html', title=title, cached_url=cached_url)
|
219 |
|
220 |
@app.route('/cached_films/<path:title>')
|
221 |
def serve_cached_film(title):
|