Spaces:
Runtime error
Runtime error
Commit
·
878be3f
1
Parent(s):
be51cd5
Update application
Browse files- app.py +1 -0
- config.py +1 -1
- download_video.py +2 -0
app.py
CHANGED
|
@@ -115,6 +115,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 115 |
|
| 116 |
**Note**:
|
| 117 |
- It will take a bit of time to complete (~40% of the original video length), so stay tuned!
|
|
|
|
| 118 |
- Remember to press Enter if you are using an external URL
|
| 119 |
""",
|
| 120 |
elem_id="container",
|
|
|
|
| 115 |
|
| 116 |
**Note**:
|
| 117 |
- It will take a bit of time to complete (~40% of the original video length), so stay tuned!
|
| 118 |
+
- If the YouTube downloader return errors, you can try again later or download video to your computer and then upload it to the app
|
| 119 |
- Remember to press Enter if you are using an external URL
|
| 120 |
""",
|
| 121 |
elem_id="container",
|
config.py
CHANGED
|
@@ -2,7 +2,7 @@ import imagehash
|
|
| 2 |
|
| 3 |
# -------------- Initializations ---------------------
|
| 4 |
|
| 5 |
-
DOWNLOAD_DIR = "
|
| 6 |
|
| 7 |
FRAME_BUFFER_HISTORY = 15 # Length of the frame buffer history to model background.
|
| 8 |
DEC_THRESH = (
|
|
|
|
| 2 |
|
| 3 |
# -------------- Initializations ---------------------
|
| 4 |
|
| 5 |
+
DOWNLOAD_DIR = "downloads"
|
| 6 |
|
| 7 |
FRAME_BUFFER_HISTORY = 15 # Length of the frame buffer history to model background.
|
| 8 |
DEC_THRESH = (
|
download_video.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import mimetypes
|
|
|
|
| 2 |
import tempfile
|
| 3 |
import requests
|
| 4 |
import os
|
|
@@ -57,6 +58,7 @@ def download_video_from_youtube(url, output_dir=DOWNLOAD_DIR):
|
|
| 57 |
def download_video(url, output_dir=DOWNLOAD_DIR):
|
| 58 |
parsed_url = urlparse(url)
|
| 59 |
domain = parsed_url.netloc.lower()
|
|
|
|
| 60 |
|
| 61 |
print("---" * 5, "Downloading video file", "---" * 5)
|
| 62 |
|
|
|
|
| 1 |
import mimetypes
|
| 2 |
+
import re
|
| 3 |
import tempfile
|
| 4 |
import requests
|
| 5 |
import os
|
|
|
|
| 58 |
def download_video(url, output_dir=DOWNLOAD_DIR):
|
| 59 |
parsed_url = urlparse(url)
|
| 60 |
domain = parsed_url.netloc.lower()
|
| 61 |
+
domain = re.sub(r"\.", "", domain) # Match for both youtube and youtu.be
|
| 62 |
|
| 63 |
print("---" * 5, "Downloading video file", "---" * 5)
|
| 64 |
|