Does youtube-dl library support download stories from instagram?
Asked Answered
I

3

9

I Use library called YouTube-dl, which can download from many sites.

it's support cookies files. I made the following code:

youtube-dl -j —-cookies /path/to/cookies.txt URLgoesHere

What I want is how to download stories from Instagram using this library? On the command line.

Impend answered 12/3, 2021 at 1:58 Comment(0)
S
20

Update: For Instagram stories of video slideshows, use yt-dlp (requires v2022.1.21):

pip install 'yt-dlp>=2022.1.21'

Just make sure you're logged in via one of the authentication methods:

  • --cookies-from-browser YOUR_BROWSER
  • --cookies /path/to/cookies.txt
  • -u YOUR_USERNAME (interactive)
  • -n (config file)
yt-dlp --cookies-from-browser firefox https://www.instagram.com/stories/highlights/17863022906349328/

# [cookies] Extracting cookies from firefox
# [cookies] Extracted 2051 cookies from firefox
# [instagram:story] 17863022906349328: Downloading JSON metadata
# [instagram:story] 17863022906349328: Downloading JSON metadata
# [instagram:story] 17863022906349328: Downloading user info
# [download] Downloading playlist: Mars AR
# [instagram:story] playlist Mars AR: Collected 7 videos; downloading 7 of them
# [download] Downloading video 1 of 7
# [info] 2515578473642074643_787132: Downloading 1 format(s): 2
# [download] Destination: Story by natgeo [2515578473642074643_787132].mp4
# [download] 100% of 793.91KiB in 00:00
# ⋮
# [download] Finished downloading playlist: Mars AR

For Instagram stories of image slideshows, use gallery-dl:

pip install gallery-dl
gallery-dl -u USERNAME -p PASSWORD https://www.instagram.com/stories/highlights/17857710373716419/

# [instagram][info] Logging in as USERNAME
# ./gallery-dl/instagram/weighthefish/2224872001634244851.jpg
# ./gallery-dl/instagram/weighthefish/2224872078683640644.jpg
# ...
# ./gallery-dl/instagram/weighthefish/2224872839329073284.jpg

Note that yt-dlp is a fork of youtube-dl (I am not affiliated with either):

yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc. The main focus of this project is adding new features and patches while also keeping up to date with the original project.

youtube-dl still doesn't support Instagram stories, though it's tagged as "todo" on their issue tracker.

Shatter answered 12/3, 2021 at 4:29 Comment(4)
give the command to do install stories .Impend
@DISASTER updated with install/usage commands for yt-dlp (just make sure the story really contains videos, not just an image slideshow)Shatter
also updated with gallery-dl commands for stories of image slideshowsShatter
you have my respect.Impend
F
1

Just type

yt-dlp --cookies-from-browser chrome <your link (stories link)>

make sure your browser is closed,
if you do this while the browser is on, the code may not work.

Fractionize answered 16/3 at 9:47 Comment(1)
Please, edit and try for How to Answer, describe the effect of what you propose and explain why it helps to solve the problem. Please avoid the impression to ask a question instead of answering. Consider taking the tour.Lowpitched
J
-2

It does now, and very gracefully, checked on version: 2021.04.17

youtube-dl https://www.instagram.com/p/<story_link>/

Jovita answered 21/6, 2021 at 6:27 Comment(4)
insta stories are /stories/... (not /p/...) and /stories/... links still do not work with youtube-dlShatter
they are posts :)Impend
It does not work. Tried several ways: youtube-dl instagram.com/stories/<account_name>/<numeric_id> youtube-dl instagram.com/stories/<numeric_id> youtube-dl instagram.com/p/<account_name>/<numeric_id> youtube-dl instagram.com/p/<numeric_id>Guernica
Sorry, my bad, I got confused with Reels..Jovita

© 2022 - 2024 — McMap. All rights reserved.