dvingerh / PyInstaLive

Python script to download Instagram livestreams.
MIT License
547 stars 111 forks source link

Unable to find cookie file #80

Closed crazzzyjeff closed 4 years ago

crazzzyjeff commented 4 years ago

Fill in this template completely. Issues not following this template will be closed and ignored.

Check the boxes below by filling [ ] with an x so it looks like [x].

Use the Preview button to ensure the template is filled in correctly.

I am using:

To report a bug, fill in the information below.

PyInstaLive information

Run pyinstalive --info and paste its output below. Don't forget to omit your username and password.

Example:

$ pyinstalive --info
---------------------------------------------------------------------------
[I] PYINSTALIVE (SCRIPT V3.2.0 - PYTHON V3.6.3) - 01-02-2019 07:00:17 PM
---------------------------------------------------------------------------
[I] To see all the available arguments, use the -h argument.

[I] PyInstaLive version:        3.2.0
[I] Python version:             2.7.17
[I] FFmpeg framework:           Available
[I] Cookie files:               None found
[I] CLI supports color:         Yes
[I] Command to run at start:    None
[I] Command to run at finish:   None
[I] Config file contents:

    [pyinstalive]
    username = xxxxx
    password = xxxxx
    download_path = /Users/Jeffrey/Downloads
    download_lives = True
    download_replays = True
    download_comments = true
    show_cookie_expiry = True
    log_to_file = True
    ffmpeg_path = 
    run_at_start =
    run_at_finish =
    use_locks = True
    clear_temp_files = False
    do_heartbeat = True
    proxy =
    verbose = False
    skip_merge = False

[I] End of PyInstaLive information screen.
---------------------------------------------------------------------------
Command used

pyinstalive -d “<xxxxx>”

Behavior
---------------------------------------------------------------------------
[I] PYINSTALIVE (SCRIPT V3.2.0 - PYTHON V2.7.17) - 03-16-2020 08:08:06 PM
---------------------------------------------------------------------------
[W] Unable to find cookie file: xxxxx.json
[I] Creating a new one.
---------------------------------------------------------------------------
[E] Could not login: 
---------------------------------------------------------------------------
Question

I have tried to reinstall pyinstalive but it still doesn’t work.

dvingerh commented 4 years ago

It can't find a login cookie because an error occurs while trying to login, thus no cookie file storing your login is created. The problem though is that Instagram doesn't seem to be returning a proper error response in your case and as such no error information is displayed.

Normal error would look like this.

---------------------------------------------------------------------------
[I] PYINSTALIVE (SCRIPT V3.2.0 - PYTHON V2.7.17) - 03-16-2020 09:23:13 PM
---------------------------------------------------------------------------
[W] Unable to find cookie file: username.json
[I] Creating a new one.
---------------------------------------------------------------------------
[E] Could not login: {"status": "fail", "error_title": "Incorrect password for username", "error_type": "bad_password", "buttons": [{"action": "dismiss", "title": "Try Again"}], "message": "The password you entered is incorrect. Please try again.", "invalid_credentials": true}
---------------------------------------------------------------------------

You could try using Windows (Boot Camp?), Python 3 instead of 2 (Python 2 is EOL) and a different internet network to ensure those aren't the cause of the problem. But given the lack of error information there's nothing I can do to help solve the problem.

dvingerh commented 4 years ago

@crazzzyjeff I did some digging through older issues, another user had the same problem on MacOS which apparently had to do with SSL certificate issues. I suggest checking out this issue for more information on how to solve the problem since this is what I believe to be the root cause of the program not working for you as well.

https://github.com/notcammy/PyInstaLive/issues/68#issuecomment-516445500

I'll try to update documentation and implement extra error checking for this particular problem when I find the spare time to do so

crazzzyjeff commented 4 years ago

The problem was solved when I install python version 3.8.2 in Terminal and reinstall pyinstalive.

Thanks a lot!!!

dvingerh commented 4 years ago

Problem is solved after changing the python in my terminal to 3.8.2! It was working fine at first, but I think I messed up some files and stuff. This happened when I reinstalled it, I don't know what to do.

---------------------------------------------------------------------------
[I] PYINSTALIVE (SCRIPT V3.2.0 - PYTHON V3.8.2) - 03-17-2020 05:20:30 AM
---------------------------------------------------------------------------
[I] Successfully logged into account: xxxxx
[I] Cookie file expiry date: 2020-06-15 at 06:01:23 AM
---------------------------------------------------------------------------
[E] Could not get user info for '“xxxxx”': 'ascii' codec can't encode character '\u201c' in position 18: ordinal not in range(128)
---------------------------------------------------------------------------

@crazzzyjeff are you still having problems? I received the above in my email but can't find the comment here on GitHub. In any case I suspect it's your input that's incorrect, '“xxxxx”' indicates your username input is being handled including the double quotes, and \u201c is a left double quote. Make sure to input commands as per the examples given here https://github.com/notcammy/PyInstaLive/blob/master/README.md#example

Note that is not the same as ", Python is pretty finnicky when it comes to character encoding.
Also, the quotation marks aren't necessarily needed since inputs like usernames can't contain spaces anyway.

crazzzyjeff commented 4 years ago

Yes, it was because of the quotation marks. I figured it out afterwards so I deleted the comment.

But I ran in to another problem when I was using the program today. It seems that the program have only recorded 300 comments and stopped recording comments afterwards during the livestream.

Screenshot 2020-03-17 at 6 41 08 PM 2

dvingerh commented 4 years ago

It can't save at a faster rate, and not all comments that are sent actually show up in someone's livestream especially with lives that have a lot of people watching/commenting. It's beyond my control. The ClientError can be ignored by the way

crazzzyjeff commented 4 years ago

OK :) Thanks a lot for your help and effort!!!

dvingerh commented 4 years ago

OK :) Thanks a lot for your help and effort!!!

No problem. This script is by no means perfect so don't hesitate to create a new issue should you have any more questions or have a bug to report.