dvingerh / PyInstaStories

Python script to download Instagram stories from Instagram users.
MIT License
329 stars 74 forks source link

--username and --password arguments #38

Closed sherl0ck17 closed 4 years ago

sherl0ck17 commented 4 years ago

Hello Dvingerh,

I am a newbie to all of this. Can I trouble you to teach me exactly which line of the file 'pyinstastories.py' do I input my username and password for it to work as intended.

Thank you so much!

dvingerh commented 4 years ago

You don't need to modify code, pass them as arguments like intended If you insist on hard coding them modify the code to your wish at L409-L410

sherl0ck17 commented 4 years ago

If I were to do supposedly like what you said, how will I be able to download those private accounts?

Back on to the issue, the only code I will have to edit is on your file and not on any files in the folder of 'instagram_private_api'?

sherl0ck17 commented 4 years ago

Cause the issue I'm having on hand is this - [E] No username/password provided, but there is no login cookie present either. [E] Please supply --username and --password arguments.

dvingerh commented 4 years ago

The error is pretty self explanatory, add --username yourusername --password yourpassword to your command And install the api dependency if you haven't already by running the command given on its repository page

https://github.com/ping/instagram_private_api#install

sherl0ck17 commented 4 years ago

I have downloaded the API - https://github.com/ping/instagram_private_api#install

" add --username yourusername --password yourpassword to your command" - You meant to type it in PowerShell itself or to hardcode the file? I am confused.

dvingerh commented 4 years ago

You meant to type it in PowerShell itself

Yes

sherl0ck17 commented 4 years ago

python3 pyinstastories.py --username xxx --password xxx -d justinbieber It failed.

dvingerh commented 4 years ago

cant help without an error message

sherl0ck17 commented 4 years ago

If you insist on hard coding them modify the code to your wish at L409-L410 - If I ever want to hard code them, do I change all 'username' & 'password' to mine as shown below?

'if args.username and args.password: ig_client = login(args.username, args.password)'

dvingerh commented 4 years ago

Remove 409 entirely and change args.username and args.password to your own username and password on line 410

I highly recommend learning the basics of Python and use of the command line before continuing to use scripts like these

sherl0ck17 commented 4 years ago

Honestly, I tried reading up on them. However, can't seem to understand them and getting them to work but understand them much better with you explaining them to me! I'm so sorry for bothering you over something so trivial.

After I've successfully logged in, I received an email about about being logged onto a Samsung SM-G930F phone, is it supposed to be like that?

dvingerh commented 4 years ago

Yes, the API dependency by default uses that phone model variable when communicating with Instagram, as seen here https://github.com/ping/instagram_private_api/blob/8eb3d726360cce264a586a0a68bc778882f41c81/instagram_private_api/constants.py#L12-L20

sherl0ck17 commented 4 years ago

How do I log out of my current session and into another account? Do I type 'python3 pyinstastories.py --username xxx2 --password xxx2'? Before I proceed to download stories from a .txt file?

sherl0ck17 commented 4 years ago

Possible to skip the downloading of users if there wasn't any stories to be downloaded?

And will the issue of Ffmpeg format be fixed?

dvingerh commented 4 years ago

How do I log out of my current session and into another account? Do I type 'python3 pyinstastories.py --username xxx2 --password xxx2'? Before I proceed to download stories from a .txt file?

Delete the credentials.json file and then you can login with a different account as you please

Possible to skip the downloading of users if there wasn't any stories to be downloaded?

It already does this.

And will the issue of Ffmpeg format be fixed?

What do you mean?

sherl0ck17 commented 4 years ago

It already does this.

I meant it in the sense that is it possible to be skipping the user (if that user does not have any stories to start with) without even downloading a folder with it's username.

What do you mean?

Downloaded a video but it isn't in high quality format, ffmpeg, which makes me wonder under what conditions will my downloaded videos be in high quality?

sherl0ck17 commented 4 years ago

Can I ask when do I 'git clone git' or 'pip install git'?

E.g., Your 'pyigposts.py' repository?

dvingerh commented 4 years ago

I meant it in the sense that is it possible to be skipping the user (if that user does not have any stories to start with) without even downloading a folder with it's username.

A check still needs to be done if the user has any stories. If there are no (new) stories then the script takes no further action and proceeds to the next user. Regardless of there being any available stories or not a folder is still created beforehand. It's a minor annoyance that I haven't bothered fixing yet.

Downloaded a video but it isn't in high quality format, ffmpeg, which makes me wonder under what conditions will my downloaded videos be in high quality?

There seems to be an xml string which contains a slightly higher bitrate video file compared to the ones in the json itself which i then download and merge the audio/video with ffmpeg. But the difference is negligible honestly

sherl0ck17 commented 4 years ago

Can I ask when do I 'git clone git' or 'pip install git'?

E.g., Your 'pyigposts.py' repository?

???

dvingerh commented 4 years ago

You can google that easily, this goes beyond the scope of troubleshooting for this repository

https://git-scm.com/docs/git-clone https://pip.pypa.io/en/stable/reference/pip_install/#description

sherl0ck17 commented 4 years ago

You can google that easily, this goes beyond the scope of troubleshooting for this repository

https://git-scm.com/docs/git-clone https://pip.pypa.io/en/stable/reference/pip_install/#description

I tried using 'pyigposts.py', error shown: Traceback (most recent call last): File "pyigposts.py", line 10, in import requests ModuleNotFoundError: No module named 'requests'

sherl0ck17 commented 4 years ago

You can google that easily, this goes beyond the scope of troubleshooting for this repository

https://git-scm.com/docs/git-clone https://pip.pypa.io/en/stable/reference/pip_install/#description

Shall I start another another topic for you to keep track of or above post is fine? Please reply to it, thanks.

sherl0ck17 commented 4 years ago

I encountered an error while downloading with PyInstaStories.

[I] Getting stories for: XXX [W] Downloading high quality videos enabled but Ffmpeg could not be found. Falling back to default. [E] A general error occurred: [Errno 22] Invalid argument

@dvingerh Any idea how to debug the last line on [Errno 22]?

dvingerh commented 4 years ago

What is the full command you are using?

sherl0ck17 commented 4 years ago

Hello, welcome back. Good to hear from you.

What is the full command you are using?

python3 pyinstastories.py --batch-file usernames.txt --taken-at --no-thumbs --hq-videos

It was downloading fine for the other users, upon reaching XXX, that error was shown.

sherl0ck17 commented 4 years ago

I tried using 'pyigposts.py', error shown: Traceback (most recent call last): File "pyigposts.py", line 10, in import requests ModuleNotFoundError: No module named 'requests'

@dvingerh I am still waiting for your reply on this, can you assist me? This is in relation to downloading of posts on Insta. Thank you.

dvingerh commented 4 years ago

If it downloads fine for other users but fails at 'XXX' then I need to know what XXX is since there's likely a character that messes up the rest of the command.

I am still waiting for your reply on this, can you assist me? This is in relation to downloading of posts on Insta. Thank you.

A single Google search would already reveal the answer, which is that you have to install the requests module with pip: pip install requests

sherl0ck17 commented 4 years ago

If it downloads fine for other users but fails at 'XXX' then I need to know what XXX is since there's likely a character that messes up the rest of the command.

Is there a more discreet way of revealing it to you and not through this platform?

dvingerh commented 4 years ago

e-mail it to dirk.ving@gmail.com

sherl0ck17 commented 4 years ago

e-mail it to dirk.ving@gmail.com

I've emailed you, do let me know if you're unable to replicate the same error.

dvingerh commented 4 years ago

@sherl0ck17 I'm not running into any problems when downloading stories from the username you sent me when using the same arguments as well as a usernames text file.