Haifeng Zhang
Haifeng Zhang

Reputation: 31935

Why requests are forbidden from Google URL Shortener

@staticmethod
def _google_url_shortener(original_url):
    try:
        data = json.dumps({'longUrl': original_url})
        result = requests.post(conf.GoogleURL, headers={
            'Content-Type': 'application/json'}, data=data)
        shortened_url = result.json()['id']
        return shortened_url
    except Exception as e:
        print('err {}'.format(e))
        return original_url

I am using Google URL Shortener to make my URLs shorter, from google, it says 1,000,000 requests per day, unfortunately, I got 403 ERROR after 2500+ requests have been sent out. It doesn't help even I drop the request TPS to 0.5

Can anyone help?

enter image description here

Upvotes: 2

Views: 478

Answers (0)

Related Questions