-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
What is googlenewsdecoder?
googlenewsdecoder is a Python package designed to decode Google News URLs. It allows you to retrieve the original URLs behind the shortened or encoded links provided by Google News.
Installation:
You can install the package using pip:
pip install googlenewsdecoder --upgradeOr, if you're feeling adventurous, install directly via GitHub:
pip install git+https://github.com/SSujitX/google-news-url-decoder@mainUsage Example:
from googlenewsdecoder import gnewsdecoder
def main():
interval_time = 1 # interval is optional, default is None
proxy = "http://user:pass@localhost:8080" # proxy is optional, default is None
source_url = "https://news.google.com/read/CBMi2AFBVV95cUxPd1ZCc1loODVVNHpnbFFTVHFkTG94eWh1NWhTeE9yT1RyNTRXMVV2S1VIUFM3ZlVkVjl6UHh3RkJ0bXdaTVRlcHBjMWFWTkhvZWVuM3pBMEtEdlllRDBveGdIUm9GUnJ4ajd1YWR5cWs3VFA5V2dsZnY1RDZhVDdORHRSSE9EalF2TndWdlh4bkJOWU5UMTdIV2RCc285Q2p3MFA4WnpodUNqN1RNREMwa3d5T2ZHS0JlX0MySGZLc01kWDNtUEkzemtkbWhTZXdQTmdfU1JJaXY?hl=en-US&gl=US&ceid=US%3Aen"
try:
decoded_url = gnewsdecoder(source_url)
if decoded_url.get("status"):
print("Decoded URL:", decoded_url["decoded_url"])
else:
print("Error:", decoded_url["message"])
except Exception as e:
print(f"Error occurred: {e}")
if __name__ == "__main__":
main()
Whatโs Next?
Weโre just getting started! Stay tuned for more updates and improvements. Contributions and feedback are welcome!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation