New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api.php access issues #1413

Closed
C4Wiz opened this Issue May 1, 2017 · 14 comments

Comments

Projects
None yet
3 participants
@C4Wiz

C4Wiz commented May 1, 2017

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:
5


[FEATURE REQUEST | QUESTION | OTHER]:

Please submit your feature request here, so it is votable by the community. It's also easier for us to track.

[BUG | ISSUE] Expected Behaviour:
bitbar plugin can access api

[BUG | ISSUE] Actual Behaviour:

bitbar plugin fails
[BUG | ISSUE] Steps to reproduce:

(Optional) Debug token generated by pihole -d:

<token>

This template was created based on the work of udemy-dl.

@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

this worked fine till updating to 3.0, below is the plugin code i use

pihole = "http://xx.xxx.xx.xx/admin/"

try:
    url = pihole + "api.php"
    result = urllib2.urlopen(url, timeout = 15).read()
    json = json.loads(result)
    # print "🌍"
    print "| image=iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDI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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAIXqAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP+oAAD/DwAAegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqAACB5QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/+wAAP+jAAD/MgAAcQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAf90AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/4AAA/7gAAP/cAAD/JgAAbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAHjdAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP/oAAD/kgAA/+wAAP/bAAD/JAAAawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAA2AAB14QAA//8AAP/6AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/90AAP+UAAD/9gAA//8AAP/TAAD/HwAAXgAAAAADAAAAAQAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAAAAAAAAAAADgAAbp8AAP/HAAD/mQAA/5cAAP++AAD/+QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/lgAA/5UAAP//AAD//wAA//8AAP/LAAD+IgAAVSAAAAAUAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAAAgAAGyiAAD/6AAA/9UAAP/ZAAD/xQAA/3sAAP9PAAD/wwAA//8AAP//AAD//wAA//8AAP//AAD//wAA/8YAAP8/AAD/2wAA//8AAP//AAD//wAA//8AAP+9AAD6HwAATwkAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAYAABcxQAA//8AAP//AAD//wAA//8AAP//AAD//wAA/44AAP8KAAD/dAAA/9sAAP//AAD//wAA//8AAP/AAAD/FQAA/5QAAP//AAD//wAA//8AAP//AAD//wAA//8AAP+oAADxBwAAPAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAG54AAOL/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/4YAAP8AAAD/EAAA/0IAAP9hAAD/QwAA/wAAAP9eAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP94AADKAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAACwuAACI7AAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/5QAA/yAAAP8AAAD/AAAA/wAAAP8AAAD/BQAA/9cAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/9sAAP0NAABVAAAAC////wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AGQAAiG0AAOX/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP/9AAD/UAAA/wAAAP8AAAD/AAAA/wAAAP9IAAD/+QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/+gAA/0oAAM0DAABu////AP///wD///8A////AP///wACAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAALCAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAD4AAAAAAAAAAAAAAAAAAAAAAAAAB0AAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAEwAAIQcAACcAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAOAAALXPAAC++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5wAAAM4AAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPUAAADiAADI9gAAwwAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAAAAAAIAADvSAADz/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP+YAAD/AAAA/wgAAP8VAAD/CAAA/wAAAP8MAAD/2wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/0gAA8wEAADsAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAEkAAKH8AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/1gAA/w8AAP9ZAAD/vQAA/9oAAP++AAD/gAAA/xAAAP87AAD/9AAA//8AAP//AAD//wAA//8AAP//AAD//wAA//wAAP9IAACeAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAAAAAAEnMAAL//AAD//wAA//8AAP//AAD//wAA//8AAP9JAAD/eAAA//8AAP//AAD//wAA//8AAP//AAD/5QAA/2AAAP9eAAD/1AAA//8AAP//AAD//wAA//8AAP/sAAD/VQAAugAAAA4AAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAAAAAAAAAAE3UAAMb/AAD//wAA//8AAP//AAD/oAAA/1kAAP/2AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/78AAP+IAAD/mgAA/64AAP/GAAD/zAAA/zgAAMIAAAAPAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAYAAAANAAAAAAAAF3cAAM//AAD//wAA//8AAP9/AAD/xwAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//gAAP/SAAD/xAAA//AAAP9kAADLAAAAFQAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAABAAAABUAAAAVAAAAAAAAHHIAAMr/AAD/4AAA/44AAP/rAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/gAAAygkAABsJAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAEAAAAFAAAABYAAAATAAAAAAAAHIAAAMLzAAD/mAAA/+oAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/3cAAMYAAAAeHgAAAAkAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAQAAAAUAAAAFgAAABUAAAAMAAAAAQAAFHMAAMfFAAD/9QAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP9+AADNAAAAGREAAAAgAAAACQAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAD///8A////AP///wD///8A////AAAAAAAAAAAABAAAABQAAAAWAAAAFAAAABQAAAANAAAADQAAF0QAAM/oAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD/hwAA2wMAAB0SAAAAGgAAACAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////AP///wD///8AAP///wD///8A////AP///wD///8AAAAAAAAAAAAEAAAAFAAAABYAAAAUAAAAEgAAABUAAAAiAAAAAAAAHV4AAMv/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA/4cAANsMAAAnHgAAABkAAAAYAAAAIAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wD///8A////AP///wAA////AP///wD///8A////AP///wAAAAAAAAAAAAQAAAAUAAAAFgAAABQAAAASAAAAFQAAACQAAAAKAAAAAAAAHGsAALz2AAD//wAA//8AAP//AAD//wAA//IAAP9tAAC/DAAAJyQAAAAfAAAAGQAAABgAAAAgAAAACQAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AAH///8AAAAAAAAAAAAAAAAAAAAAAAEBAQAAAAAABAAAABAAAAACAAAA/gAAAP4AAAADAAAADwAAAOcAAAD+AAAA9wAABioAAGtgAABeOQAAHPsAAP/BAADepQAAoNwAAJ4jAAD6AwAAAPkAAAD6AAAA/wAAAAgAAADpAAAA9wAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAQAA//8wabirP4J+hgAAAABJRU5ErkJggg=="
    print "---"
    print "Ads blocked Today: | color=blue"
    print json['ads_blocked_today'] + "| color=black"
    print "Percentage of Ads in Todays Traffic:| color=blue"
    print json['ads_percentage_today'] + "%| color=black"
    print "DNS queries Today: | color=blue"
    print json['dns_queries_today'] + "| color=black"
    print "Domains Being Blocked: | color=blue"
    print json['domains_being_blocked'] + "|  color=black"
    print "---"
    print "Launch Pi-Hole web interface" + "| color=red href=" + pihole
    print "---"
    
except:
    print ""
    print "---"
    print "Pi-Hole not found | color=red"
    print "---"
@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

(I fixed the formatting for you) What is the error that it encounters?

@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

Run pihole -d for a debug token.

@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

i just says not found

@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

Replace the last few lines with:

except Exception as e:
    print e
    print ""
    print "---"
    print "Pi-Hole not found | color=red"
    print "---"
@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

screen shot 2017-05-01 at 4 36 48 pm

@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

---=== Your debug token is : agjp2npbwz Please make a note of it. ===---

@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

Your script needs some work. The json is parsed to an int, so you need to surround it with str() before you add it to another string.

@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

can you give me an example?

what changed in 3.0 to require this?

@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

The API changed from strings to numbers. Before:

{"domains_being_blocked":"104546","dns_queries_today":"8238", ...}

After:

{"domains_being_blocked":104546,"dns_queries_today":8238, ...}
@Mcat12

This comment has been minimized.

Member

Mcat12 commented May 1, 2017

For example, on this line you'd change

print json['ads_blocked_today'] + "| color=black"

to

print str(json['ads_blocked_today']) + "| color=black"
@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

you sir are a life saver, thank you soooo much! it's working now

@C4Wiz

This comment has been minimized.

C4Wiz commented May 1, 2017

All fixed and expanded to include the NEW api calls:

screen shot 2017-05-01 at 5 14 54 pm

@dschaper

This comment has been minimized.

Member

dschaper commented May 1, 2017

Thanks!

@dschaper dschaper closed this May 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment