Skip to content

Fix the exception of missing "current_time" #90

@seanxlgit

Description

@seanxlgit

Got an error when query the IP tracker. The problem was on line 77 of file "GhostTR.py" where the code tried to access ip_data["timezone"]["current_time"] directly, but the API response doesn't always include the current_time key.
I propose to change it to use .get() with a default value:

`print(f"{Wh} Current Time :{Gr}", ip_data.get("timezone", {}).get("current_time", "N/A"))`

This should handle the exceptions of missing "current_time".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions