Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Cant use on web server #53

Open
Ryandesigns09 opened this issue Jul 19, 2023 · 3 comments
Open

Cant use on web server #53

Ryandesigns09 opened this issue Jul 19, 2023 · 3 comments
Labels
question Further information is requested

Comments

@Ryandesigns09
Copy link

I've created a flask web app that works locally but when I go to deploy it on glitch or pythonanywhere when I try and pull the info (ie use a search box to find a users info) it doesn't return anything and I can't see any issues as to why error wise. Do you have any suggestions on how to resolve?

@Danie1
Copy link
Owner

Danie1 commented Jul 19, 2023

Hey @Ryandesigns09, do you have any additional details?
Have you tried raising the LOG_LEVEL to DEBUG? It will print all of the requests and responses to Threads.net made by the API.

@Danie1 Danie1 added help wanted Extra attention is needed question Further information is requested and removed help wanted Extra attention is needed labels Jul 19, 2023
@Ryandesigns09
Copy link
Author

Ryandesigns09 commented Jul 20, 2023

Indeed, here's a bit of the response. it looks similar to my desktop response except from Keyword arguments: onwards.

` * Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.

  • Debugger is active!
  • Debugger PIN: 956-959-090
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET /static/images/zuck.png HTTP/1.1" 304 -
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET /static/images/threadsicon.png HTTP/1.1" 304 -
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET /static/images/score.png HTTP/1.1" 304 -
    127.0.0.1 - - [20/Jul/2023 02:58:22] "GET /static/images/tombrady.png HTTP/1.1" 304 -
    INFO:<---- START ---->
    Keyword arguments:
    [message]: ["ThreadsAPI.init Configurations"]
    [settings_path]: [".session.json"]
    [log_level]: [10]
    [http_session_class]: ["AioHTTPSession"]
    [settings]: [{
    "authentication": {
    "encrypted_token": null
    },
    "timezone": {
    "offset": "-86399"
    },
    "device": {
    "id": "android-79dc60f16ac1438a",
    "manufacturer": "OnePlus",
    "model": "ONEPLUS+A3010",
    "android_version": 25,
    "android_release": "7.1.1"
    }
    }]
    <---- END ---->
    INFO:Fetching user_id for user [ryguynft] anonymously
    INFO:Refreshing public token
    DEBUG:<---- START ---->
    Keyword arguments:
    [title]: ["PUBLIC REQUEST"]
    [type]: ["GET"]
    [url]: ["https://www.instagram.com/instagram"]
    [headers]: [{
    "Authority": "www.threads.net",
    "Accept": "/",
    "Accept-Language": "en-US,en;q=0.9",
    "Cache-Control": "no-cache",
    "Content-Type": "application/x-www-form-urlencoded",
    "Origin": "https://www.threads.net",
    "Pragma": "no-cache",
    "Sec-Fetch-Dest": "document",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "cross-site",
    "Sec-Fetch-User": "?1",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
    "X-ASBD-ID": "129477",
    "X-IG-App-ID": "238260118697367"
    }]
    <---- END ---->
    DEBUG:<---- START ---->
    Keyword arguments:
    [title]: ["PUBLIC RESPONSE"]
    [response]: ["<html class="_9dls" lang="en" dir="ltr"><link data-default-icon="https://static.cdninstagram.com/rsrc.php/v3/yb/r/lswP1OF1o6P.png" rel="icon" sizes="192x192" href="https://static.cdninstagram.com/rsrc.php/v3/yb/r/lswP1OF1o6P.png" /><meta name="robots" content="noarchive, noimageindex" /><meta charset="utf-8" /><meta name="apple-mobile-web-app-status-bar-style" content="default" /><meta name="mobile-web-app-capable" content="yes" /><meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=2, viewport-fit=cover" /><meta name="theme-color" content="#ffffff" /><link rel="apple-touch-icon" sizes="76x76" href="https://static.cdninstagram.com/rsrc.php/v3/yR/r/lam-fZmwmvn.png" /><link rel="apple-touch-icon" sizes="120x120" href="https://static.cdninstagram.com/rsrc.php/v3/ys/r/aM-g435MtEX.png" /><link rel="apple-touch-icon" sizes="152x152" href="https://static.cdninstagram.com/rsrc.php/v3/yx/r/H1l_HHqi4p6.png" /><link rel="apple-touch-icon" sizes="167x167" href="https://static.cdninstagram.com/rsrc.php/v3/yB/r/-7Z_RkdLJUX.png" /><link rel="apple-touch-icon" sizes="180x180" href="https://static.cdninstagram.com/rsrc.php/v3/yG/r/De-Dwpd5CHc.png" /><link data-default-icon="https://static.cdninstagram.com/rsrc.php/yv/r/BTPhT6yIYfq.ico" rel="shortcut icon" type="image/x-icon" href="https://static.cdninstagram.com/rsrc.php/yv/r/BTPhT6yIYfq.ico" /><link rel="alternate" href="https://www.instagram.com/instagram/" hreflang="x-default" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=en" hreflang="en" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=fr" hreflang="fr" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=it" hreflang="it" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=de" hreflang="de" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=es" hreflang="es" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=zh-cn" hreflang="zh-cn" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=zh-tw" hreflang="zh-tw" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=ja" hreflang="ja" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=ko" hreflang="ko" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=pt" hreflang="pt" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=pt-br" hreflang="pt-br" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=af" hreflang="af" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=cs" hreflang="cs" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=da" hreflang="da" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=el" hreflang="el" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=fi" hreflang="fi" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=hr" hreflang="hr" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=hu" hreflang="hu" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=id" hreflang="id" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=ms" hreflang="ms" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=nb" hreflang="nb" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=nl" hreflang="nl" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=pl" hreflang="pl" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=ru" hreflang="ru" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=sk" hreflang="sk" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=sv" hreflang="sv" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=th" hreflang="th" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=tl" hreflang="tl" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=tr" hreflang="tr" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=hi" hreflang="hi" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=bn" hreflang="bn" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=gu" hreflang="gu" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=kn" hreflang="kn" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=ml" hreflang="ml" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=mr" hreflang="mr" /><link rel="alternate" href="https://www.instagram.com/instagram/?hl=pa" hreflang="pa" /><link rel="alternate" href="https://ww
    `

@Danie1
Copy link
Owner

Danie1 commented Jul 20, 2023

Thanks, can you please share the last request+response? Each of them has "[title]: ["PUBLIC REQUEST"]" for request and "[title]: ["PUBLIC RESPONSE"] for the response.
From what you shared so far, it looks quite standard (no issues).

  • did you try using another http_session_class, for example the InstagrapiHTTPSession one?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants