Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,10 +44,15 @@ L = instaloader.Instaloader()
|
|
44 |
|
45 |
def download_instagram_video(url):
|
46 |
try:
|
47 |
-
#
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
# Download the post
|
51 |
post = instaloader.Post.from_shortcode(L.context, shortcode)
|
52 |
|
53 |
# Create a temporary directory
|
|
|
44 |
|
45 |
def download_instagram_video(url):
|
46 |
try:
|
47 |
+
# Handle both post and reel URLs
|
48 |
+
if "reel" in url:
|
49 |
+
shortcode = url.split("/")[-2]
|
50 |
+
elif "p" in url:
|
51 |
+
shortcode = url.split("/")[-2]
|
52 |
+
else:
|
53 |
+
return None
|
54 |
|
55 |
+
# Download the post/reel
|
56 |
post = instaloader.Post.from_shortcode(L.context, shortcode)
|
57 |
|
58 |
# Create a temporary directory
|