{"id":26462040,"url":"https://github.com/ssujitx/google-news-url-decoder","last_synced_at":"2025-04-09T08:00:17.025Z","repository":{"id":242759711,"uuid":"810487186","full_name":"SSujitX/google-news-url-decoder","owner":"SSujitX","description":"A Python script to decode Google News article URLs.","archived":false,"fork":false,"pushed_at":"2025-03-31T16:14:27.000Z","size":261,"stargazers_count":159,"open_issues_count":2,"forks_count":17,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-04-02T06:06:07.749Z","etag":null,"topics":["decoder","google","google-news","google-news-api","google-news-scraper","googleapi","googlenews","googlenewsscraper","news","newsapi","python","python-script","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SSujitX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-04T19:43:40.000Z","updated_at":"2025-04-01T22:31:30.000Z","dependencies_parsed_at":"2024-06-04T21:51:23.351Z","dependency_job_id":"95187e38-495f-450c-8e2e-82acfd09f36c","html_url":"https://github.com/SSujitX/google-news-url-decoder","commit_stats":null,"previous_names":["ssujitx/google-news-url-decoder"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSujitX%2Fgoogle-news-url-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSujitX%2Fgoogle-news-url-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSujitX%2Fgoogle-news-url-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSujitX%2Fgoogle-news-url-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SSujitX","download_url":"https://codeload.github.com/SSujitX/google-news-url-decoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999856,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decoder","google","google-news","google-news-api","google-news-scraper","googleapi","googlenews","googlenewsscraper","news","newsapi","python","python-script","python3"],"created_at":"2025-03-19T05:16:40.193Z","updated_at":"2025-04-09T08:00:16.974Z","avatar_url":"https://github.com/SSujitX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/googlenewsdecoder.svg)](https://badge.fury.io/py/googlenewsdecoder)\n[![Python Versions](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue)](https://pypi.org/project/googlenewsdecoder/)\n[![Downloads](https://static.pepy.tech/badge/googlenewsdecoder)](https://pepy.tech/project/googlenewsdecoder)\n[![Downloads](https://static.pepy.tech/badge/googlenewsdecoder/week)](https://pepy.tech/project/googlenewsdecoder)\n\n# Google News Decoder\n\nGoogle News Decoder is a Python package that can decode Google News links or Google News URLs to their original URLs. It is a simple tool that saves you time and effort. If you find it useful, please support the package by hitting the star on GitHub. Your support helps keep the project going!\n\n## Update\n\n- **Version 0.1.7**:\n  - **New Feature**: Added **proxy support** to handle rate limiting and bypass restrictions.\n  - **Improved**: Enhanced error handling with a fallback mechanism for decoding parameters.\n  - **Refined**: Optimized `get_decoding_params` to try decoding via `https://news.google.com/articles` first, falling back to `https://news.google.com/rss/articles` if needed.\n  - **Updated**: Reduced occurrences of HTTP 429 (Too Many Requests).\n  - **Removed**: Logging functionality for a cleaner codebase.\n  - **Fixed**: Resolved time delay issue between requests.\n\n## Demo\n\n![Google News Decoder](https://github.com/user-attachments/assets/3a3c3279-1c54-4e19-96cb-6f22f889aa2a)\n\n## Installation\n\nYou can install this package using pip:\n\n```sh\npip install googlenewsdecoder\n```\n\n- You can upgrade this package using pip (upgrade to latest version):\n\n```sh\npip install googlenewsdecoder --upgrade\n```\n\n## Supported Proxy Formats\n\n- **HTTP/HTTPS Proxy**:\n\n  - **With authentication**: `http://user:pass@host:port` or `https://user:pass@host:port`\n  - **Without authentication**: `http://host:port` or `https://host:port`\n\n- **SOCKS5 Proxy**:\n\n  - **With authentication**: `socks5://user:pass@host:port`\n  - **Without authentication**: `socks5://host:port`\n\n- **IP and Port Only**:\n  - **HTTP**: `http://127.0.0.1:8080`\n  - **SOCKS5**: `socks5://127.0.0.1:1080`\n\n## Usage\n\nHere is an example of how to use this package with different decoders:\n\n### Using gnewsdecoder\n\n```python\nfrom googlenewsdecoder import gnewsdecoder\n\ndef main():\n    interval_time = 1  # interval is optional, default is None\n\n    source_url = \"https://news.google.com/read/CBMi2AFBVV95cUxPd1ZCc1loODVVNHpnbFFTVHFkTG94eWh1NWhTeE9yT1RyNTRXMVV2S1VIUFM3ZlVkVjl6UHh3RkJ0bXdaTVRlcHBjMWFWTkhvZWVuM3pBMEtEdlllRDBveGdIUm9GUnJ4ajd1YWR5cWs3VFA5V2dsZnY1RDZhVDdORHRSSE9EalF2TndWdlh4bkJOWU5UMTdIV2RCc285Q2p3MFA4WnpodUNqN1RNREMwa3d5T2ZHS0JlX0MySGZLc01kWDNtUEkzemtkbWhTZXdQTmdfU1JJaXY?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\"\n\n    try:\n        decoded_url = gnewsdecoder(source_url, interval=interval_time)\n\n        if decoded_url.get(\"status\"):\n            print(\"Decoded URL:\", decoded_url[\"decoded_url\"])\n        else:\n            print(\"Error:\", decoded_url[\"message\"])\n    except Exception as e:\n        print(f\"Error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Using gnewsdecoder with proxy\n\n```python\nfrom googlenewsdecoder import gnewsdecoder\n\ndef main():\n    interval_time = 1  # interval is optional, default is None\n    proxy = \"http://user:pass@localhost:8080\" # proxy is optional, default is None\n\n    source_url = \"https://news.google.com/read/CBMi2AFBVV95cUxPd1ZCc1loODVVNHpnbFFTVHFkTG94eWh1NWhTeE9yT1RyNTRXMVV2S1VIUFM3ZlVkVjl6UHh3RkJ0bXdaTVRlcHBjMWFWTkhvZWVuM3pBMEtEdlllRDBveGdIUm9GUnJ4ajd1YWR5cWs3VFA5V2dsZnY1RDZhVDdORHRSSE9EalF2TndWdlh4bkJOWU5UMTdIV2RCc285Q2p3MFA4WnpodUNqN1RNREMwa3d5T2ZHS0JlX0MySGZLc01kWDNtUEkzemtkbWhTZXdQTmdfU1JJaXY?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\"\n\n    try:\n        decoded_url = gnewsdecoder(source_url, interval=interval_time, proxy=proxy)\n\n        if decoded_url.get(\"status\"):\n            print(\"Decoded URL:\", decoded_url[\"decoded_url\"])\n        else:\n            print(\"Error:\", decoded_url[\"message\"])\n    except Exception as e:\n        print(f\"Error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Using a for loop to decode multiple URLs\n\n```python\nfrom googlenewsdecoder import gnewsdecoder\n\ndef main():\n    interval_time = 1  # interval is optional, default is None\n\n    source_urls = [\n        \"https://news.google.com/read/CBMilgFBVV95cUxOM0JJaFRwV2dqRDk5dEFpWmF1cC1IVml5WmVtbHZBRXBjZHBfaUsyalRpa1I3a2lKM1ZnZUI4MHhPU2sydi1nX3JrYU0xWjhLaHNfU0N6cEhOYVE2TEptRnRoZGVTU3kzZGJNQzc2aDZqYjJOR0xleTdsemdRVnJGLTVYTEhzWGw4Z19lR3AwR0F1bXlyZ0HSAYwBQVVfeXFMTXlLRDRJUFN5WHg3ZTI0X1F4SjN6bmFIck1IaGxFVVZyOFQxdk1JT3JUbl91SEhsU0NpQzkzRFdHSEtjVGhJNzY4ZTl6eXhESUQ3XzdWVTBGOGgwSmlXaVRmU3BsQlhPVjV4VWxET3FQVzJNbm5CUDlUOHJUTExaME5YbjZCX1NqOU9Ta3U?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\",\n        \"https://news.google.com/read/CBMiiAFBVV95cUxQOXZLdC1hSzFqQVVLWGJVZzlPaDYyNjdWTURScV9BbVp0SWhFNzZpSWZxSzdhc0tKbVlHMU13NmZVOFdidFFkajZPTm9SRnlZMWFRZ01CVHh0dXU0TjNVMUxZNk9Ibk5DV3hrYlRiZ20zYkIzSFhMQVVpcTFPc00xQjhhcGV1aXM00gF_QVVfeXFMTmtFQXMwMlY1el9WY0VRWEh5YkxXbHF0SjFLQVByNk1xS3hpdnBuUDVxOGZCQXl1QVFXaUVpbk5lUGgwRVVVT25tZlVUVWZqQzc4cm5MSVlfYmVlclFTOUFmTHF4eTlfemhTa2JKeG14bmNabENkSmZaeHB4WnZ5dw?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\"\n    ]\n\n    for url in source_urls:\n        try:\n            decoded_url = gnewsdecoder(url, interval=interval_time)\n            if decoded_url.get(\"status\"):\n                print(\"Decoded URL:\", decoded_url[\"decoded_url\"])\n            else:\n                print(\"Error:\", decoded_url[\"message\"])\n        except Exception as e:\n            print(f\"Error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Using a for loop to decode multiple URLs with Proxy\n\n```python\nfrom googlenewsdecoder import gnewsdecoder\n\ndef main():\n    interval_time = 1  # interval is optional, default is None\n    proxy = \"http://user:pass@localhost:8080\" # proxy is optional, default is None\n\n    source_urls = [\n        \"https://news.google.com/read/CBMilgFBVV95cUxOM0JJaFRwV2dqRDk5dEFpWmF1cC1IVml5WmVtbHZBRXBjZHBfaUsyalRpa1I3a2lKM1ZnZUI4MHhPU2sydi1nX3JrYU0xWjhLaHNfU0N6cEhOYVE2TEptRnRoZGVTU3kzZGJNQzc2aDZqYjJOR0xleTdsemdRVnJGLTVYTEhzWGw4Z19lR3AwR0F1bXlyZ0HSAYwBQVVfeXFMTXlLRDRJUFN5WHg3ZTI0X1F4SjN6bmFIck1IaGxFVVZyOFQxdk1JT3JUbl91SEhsU0NpQzkzRFdHSEtjVGhJNzY4ZTl6eXhESUQ3XzdWVTBGOGgwSmlXaVRmU3BsQlhPVjV4VWxET3FQVzJNbm5CUDlUOHJUTExaME5YbjZCX1NqOU9Ta3U?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\",\n        \"https://news.google.com/read/CBMiiAFBVV95cUxQOXZLdC1hSzFqQVVLWGJVZzlPaDYyNjdWTURScV9BbVp0SWhFNzZpSWZxSzdhc0tKbVlHMU13NmZVOFdidFFkajZPTm9SRnlZMWFRZ01CVHh0dXU0TjNVMUxZNk9Ibk5DV3hrYlRiZ20zYkIzSFhMQVVpcTFPc00xQjhhcGV1aXM00gF_QVVfeXFMTmtFQXMwMlY1el9WY0VRWEh5YkxXbHF0SjFLQVByNk1xS3hpdnBuUDVxOGZCQXl1QVFXaUVpbk5lUGgwRVVVT25tZlVUVWZqQzc4cm5MSVlfYmVlclFTOUFmTHF4eTlfemhTa2JKeG14bmNabENkSmZaeHB4WnZ5dw?hl=en-US\u0026gl=US\u0026ceid=US%3Aen\"\n    ]\n\n    for url in source_urls:\n        try:\n            decoded_url = gnewsdecoder(url, interval=interval_time, proxy=proxy)\n            if decoded_url.get(\"status\"):\n                print(\"Decoded URL:\", decoded_url[\"decoded_url\"])\n            else:\n                print(\"Error:\", decoded_url[\"message\"])\n        except Exception as e:\n            print(f\"Error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Thank You\n\nThank you for installing and using Google News Decoder! I hope this tool saves you time and effort when working with Google News URLs. If you find it useful, please consider hitting the star button on GitHub. If you’d like to contribute or fork the project, your support is greatly appreciated. Thank you for your support!\n\n## Credits\n\n- Original script by [huksley](https://gist.github.com/huksley/)\n\n![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2FSSujitX%2Fgoogle-news-url-decoder\u0026countColor=%23263759\u0026labelStyle=upper)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssujitx%2Fgoogle-news-url-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssujitx%2Fgoogle-news-url-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssujitx%2Fgoogle-news-url-decoder/lists"}