I am using Web2Py and want to use module pafy. so i first wrote the simple code in localhost which was import pafy video = pafy.new("Here i wrote the URL of the youtube video which i want to get") this is working in localhost but in pythonanywhere it is not working but module was installed by me and also import pafy does not showing any error and if i removed the code line video = pafy.new("URL") the error is also removed. the error which i got is as given below.
Traceback (most recent call last): File "/home/tushar992/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/tushar992/web2py/applications/ytd/controllers/default.py", line 15, in <module> File "/home/tushar992/web2py/gluon/globals.py", line 412, in <lambda> self._caller = lambda f: f() File "/home/tushar992/web2py/applications/ytd/controllers/default.py", line 10, in second video = pafy.new(dlink) File "/home/tushar992/.local/lib/python2.7/site-packages/pafy/pafy.py", line 145, in new return Pafy(url, basic, gdata, signature, size, callback) File "/home/tushar992/.local/lib/python2.7/site-packages/pafy/pafy.py", line 1076, in init self.fetch_basic() File "/home/tushar992/.local/lib/python2.7/site-packages/pafy/pafy.py", line 1119, in fetch_basic self.dash = _extract_dash(self._dashurl) File "/home/tushar992/.local/lib/python2.7/site-packages/pafy/pafy.py", line 302, in _extract_dash dashdata = fetch_decode(dashurl) File "/home/tushar992/.local/lib/python2.7/site-packages/pafy/pafy.py", line 97, in fetch_decode raise e HTTPError: HTTP Error 403: Forbidden