FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python/web_programming/instagram_video.py at master · fusionplus5/Python · GitHub
fusionplus5
/
Python
Public
forked from
TheAlgorithms/Python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Python
/
web_programming
/
instagram_video.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (12 loc) · 607 Bytes
Breadcrumbs
Python
/
web_programming
/
instagram_video.py
Copy path
File metadata and controls
17 lines (12 loc) · 607 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from
datetime
import
UTC
,
datetime
import
requests
def
download_video
(
url
:
str
)
->
bytes
:
base_url
=
"https://downloadgram.net/wp-json/wppress/video-downloader/video?url="
video_url
=
requests
.
get
(
base_url
+
url
,
timeout
=
10
).
json
()[
0
][
"urls"
][
0
][
"src"
]
return
requests
.
get
(
video_url
,
timeout
=
10
).
content
if
__name__
==
"__main__"
:
url
=
input
(
"Enter Video/IGTV url: "
).
strip
()
file_name
=
f"
{
datetime
.
now
(
tz
=
UTC
).
astimezone
():%Y-%m-%d_%H:%M:%S
}
.mp4"
with
open
(
file_name
,
"wb"
)
as
fp
:
fp
.
write
(
download_video
(
url
))
print
(
f"Done. Video saved to disk as
{
file_name
}
."
)
Back
|
FazBrowse Home
|
New Git URL