instagram_private_api.errors.ClientError: Not Found - python

I am trying to use Osintgram to get reconnaissance on target but I am getting error
This was done on a newly created Instagram account
Does anybody know why this doesn't work
This is the error below
Attempt to login...
Error parsing error response: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/instagram_private_api/client.py", line 523, in _call_api
response = self.opener.open(req, timeout=self.timeout)
File "/usr/lib/python3.10/urllib/request.py", line 525, in open
response = meth(req, response)
File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
response = self.parent.error(
File "/usr/lib/python3.10/urllib/request.py", line 563, in error
return self._call_chain(*args)
File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kali/Osintgram/main.py", line 121, in <module>
api = Osintgram(args.id, args.file, args.json, args.command, args.output, args.cookies)
File "/home/kali/Osintgram/src/Osintgram.py", line 48, in __init__
self.setTarget(target)
File "/home/kali/Osintgram/src/Osintgram.py", line 61, in setTarget
self.following = self.check_following()
File "/home/kali/Osintgram/src/Osintgram.py", line 1159, in check_following
return self.api._call_api(endpoint)['user_detail']['user']['friendship_status']['following']
File "/usr/local/lib/python3.10/dist-packages/instagram_private_api/client.py", line 527, in _call_api
ErrorHandler.process(e, error_response)
File "/usr/local/lib/python3.10/dist-packages/instagram_private_api/errors.py", line 135, in process
raise ClientError(error_msg, http_error.code, error_response)
instagram_private_api.errors.ClientError: Not Found
python3 Osintgram <target>
I expected a successful login

Related

Receiving error downloading with urllib via url

Using the code below, this should have downloaded ~14,000 images. I know the call works for the cards because I ran this without the image download.
A blob file showed up in my downloads, but then was deleted. No files to be found.
Where is the potential error? When this is successful - where would they potentially download to?
Traceback (most recent call last):
File "c:\Users\toril\OneDrive\Documents\Pokemon AI\image download.py", line 28, in <module>
urllib.request.urlretrieve("https://images.pokemontcg.io/sm75/1_hires.png", "sm75-1.jpg")
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 241, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 525, in open
response = meth(req, response)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 563, in error
return self._call_chain(*args)
fields = ['card', 'c_image']
Cards = Card.all()
with open ('pokemontest3.csv', 'w', newline='', encoding='utf-8') as csv_file:
csvwriter = csv.writer(csv_file)
csvwriter.writerow(fields)
for card in Cards:
card = (card.name, card.images.small)
rows = card
csvwriter.writerow(rows)
urllib.request.urlretrieve("https://images.pokemontcg.io/sm75/1_hires.png", "sm75-1.jpg")
Why all the CSV-code, if it's a problem with image-fetching?
Why downloading the same image is within a loop?
It looks like your traceback is truncated, and it's a simple "403 Forbidden" error:
>> urllib.request.urlretrieve("https://images.pokemontcg.io/sm75/1_hires.png", "/tmp/sm75-1.jpg")
Traceback (most recent call last):
File "<input>", line 1, in <module>
urllib.request.urlretrieve("https://images.pokemontcg.io/sm75/1_hires.png", "/tmp/sm75-1.jpg")
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 241, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 525, in open
response = meth(req, response)
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 634, in http_response
response = self.parent.error(
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 563, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 496, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python#3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request
.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Getting error code when trying to download using pytube

Not sure what it is, but its been driving me nuts and im such a newbie I tried so many things but im not sure what it means, ive tried installing and reinstalling pytube but nothing changed.
Here's my code
from pytube import YouTube
link = input("Enter in a link: ")
video = YouTube(link)
print(video.title)
print(video.streams.filter(progressive=True))
stream = video.streams.get_by_itag(22)
stream.download()
print("Video downloaded")
The entire error message:
Traceback (most recent call last):
- File "c:\PytubeDownloader\YoutubeDownloader2.py", line 5, in <module>
video = YouTube(link)
- File "C:\Python\lib\site-packages\pytube\__main__.py", line 91, in __init__
self.prefetch()
- File "C:\Python\lib\site-packages\pytube\__main__.py", line 181, in prefetch
self.vid_info_raw = request.get(self.vid_info_url)
- File "C:\Python\lib\site-packages\pytube\request.py", line 36, in get
return _execute_request(url).read().decode("utf-8")
- File "C:\Python\lib\site-packages\pytube\request.py", line 24, in _execute_request
return urlopen(request) # nosec
- File "C:\Python\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
- File "C:\Python\lib\urllib\request.py", line 525, in open
response = meth(req, response)
- File "C:\Python\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
- File "C:\Python\lib\urllib\request.py", line 557, in error
result = self._call_chain(*args)
- File "C:\Python\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
- File "C:\Python\lib\urllib\request.py", line 749, in http_error_302
return self.parent.open(new, timeout=req.timeout)
- File "C:\Python\lib\urllib\request.py", line 525, in open
response = meth(req, response)
- File "C:\Python\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
- File "C:\Python\lib\urllib\request.py", line 563, in error
return self._call_chain(*args)
- File "C:\Python\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
- File "C:\Python\lib\urllib\request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone
Ok so I did what was recommended in Pytube: urllib.error.HTTPError: HTTP Error 410: Gone and now im getting a completely different error
Traceback (most recent call last):
File "c:\PytubeDownloader\YoutubeDownloader2.py", line 9, in
print(video.streams.filter(progressive=True))
File "C:\Python\lib\site-packages\pytube_main_.py", line 292, in streams
return StreamQuery(self.fmt_streams)
File "C:\Python\lib\site-packages\pytube_main_.py", line 184, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "C:\Python\lib\site-packages\pytube\extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "C:\Python\lib\site-packages\pytube\cipher.py", line 33, in init
raise RegexMatchError(
pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W
Experienced same error. In cipher.py replace the regexs in pattern in get_initial_function_name with:
r'\bc\s*&&\s*d\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\('.

Getting 504 error when trying to parse some text with tika in python

Some weeks ago I had tika-python working without any issue in Windows 10. Today I had to re-create my virtualenv and upgraded tika to version 1.19 but when I tried to use it as usual and I got 502 and 504 errors all the time.
I tried to use it in ubuntu18.04 and with previous tika versions and nothing changed.
Can anyone help?
(I'm not a native english speaker so sorry if my english is not very good)
parsed_data = parser.from_buffer(buffer)
2019-05-25 20:40:42,446 [MainThread ] [INFO ] Retrieving http://search.maven.org/remotecontent?filepath=org/apache/tika/tika-server/1.15/tika-server-1.15.jar.md5 to /tmp/tika-server.jar.md5.
Traceback (most recent call last):
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/tika.py", line 651, in getRemoteJar
urlretrieve(urlOrPath, destPath)
File "/usr/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 504: Gateway Time-out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/parser.py", line 51, in from_buffer
{'Accept': 'application/json'}, False)
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/tika.py", line 506, in callServer
serverEndpoint = checkTikaServer(scheme, serverHost, port, tikaServerJar, classpath)
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/tika.py", line 557, in checkTikaServer
if not checkJarSig(tikaServerJar, jarPath):
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/tika.py", line 572, in checkJarSig
getRemoteJar(tikaServerJar + ".md5", jarPath + ".md5")
File "/home/ohm/Documentos/TFG/venv/lib/python3.7/site-packages/tika/tika.py", line 661, in getRemoteJar
urlretrieve(urlOrPath, destPath)
File "/usr/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPErr: HTTP Error 502: Bad Gateway

yahoo_finance api throws 404. urllib2.HTTPError: HTTP Error 400: Bad Request

$ pip install yahoo-finance
$ python
Then in python console,
>>> from yahoo_finance import Share
>>> yahoo = Share('YHOO')
Traceback (most recent call last): File "", line 1, in File
"/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/init.py",
line 178, in init
self.refresh() File "/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/init.py",
line 142, in refresh
self.data_set = self._fetch() File "/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/init.py",
line 181, in _fetch
data = super(Share, self)._fetch() File "/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/init.py",
line 134, in _fetch
data = self._request(query) File "/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/init.py",
line 118, in _request
response = yql.YQLQuery().execute(query) File "/Users/ishandutta2007/virtualenvironment/googlfin/lib/python2.7/site-packages/yahoo_finance/yql.py",
line 61, in execute
'env': DATATABLES_URL File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request

Urllib2 - Django - Broken Pipe

I am new to Django and I am experiencing some troubles posting data to a django webapp.
On the django side I have a form (backed by couchdb - couchdbkit django ext.).
On the client side I post data with urllib2, in bulk (going through a list of data to post one by one)
data = urllib.urlencode(param)
req = urllib2.Request(OBJECT_SERVICE_URL + '/objects/create/', data)
req.add_header('Content-type', 'application/x-www-form-urlencoded')
res = urllib2.urlopen(req)
res.close()
After one record (one post passing), it get the message below, running again the next line passes and I have again this message :
res = urllib2.urlopen(req)
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.6/urllib2.py", line 435, in error
return self._call_chain(*args)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/urllib2.py", line 518, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: INTERNAL SERVER ERROR
The server says :
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 284, in run
self.finish_response()
File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 324, in finish_response
self.write(data)
File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 420, in write
self._write(data)
File "/usr/lib/python2.6/socket.py", line 318, in write
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59571)
self.flush()
File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 104] Connection reset by peer
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 283, in _handle_request_noblock
----------------------------------------
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 309, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 570, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "/usr/lib/python2.6/SocketServer.py", line 618, in __init__
self.finish()
File "/usr/lib/python2.6/SocketServer.py", line 661, in finish
self.wfile.flush()
File "/usr/lib/python2.6/socket.py", line 297, in flush
self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
I must state that I am working on the embedded django development web server...
And here is the output of the test :
======================================================================
ERROR: test_create_object (objects.tests.ObjectAppTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/patrick/workspace_py/objects/tests.py", line 21, in test_create_object
rs = c.post('/objects/create/', param)
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 455, in post
response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 256, in post
return self.request(**r)
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 387, in request
response = self.handler(environ)
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 84, in __call__
response = self.get_response(request)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 169, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 218, in handle_uncaught_exception
return callback(request, **param_dict)
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/coffin/views/defaults.py", line 34, in server_error
content = render_to_string(template_name, Context({}))
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/coffin/template/loader.py", line 50, in render_to_string
template = get_template(template_name)
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/coffin/template/loader.py", line 24, in get_template
return env.get_template(template_name)
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/jinja2/environment.py", line 719, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/jinja2/environment.py", line 693, in _load_template
template = self.loader.load(self, name, globals)
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/jinja2/loaders.py", line 115, in load
source, filename, uptodate = self.get_source(environment, name)
File "/home/patrick/workspace_py/env/lib/python2.6/site-packages/jinja2/loaders.py", line 377, in get_source
raise TemplateNotFound(template)
TemplateNotFound: 500.html
----------------------------------------------------------------------
Does anyone know how to fix ?
Patrick
Some times I found weird errors and quick connection resets using development server (like in your log). If your application is about http, REST and webservices you should use Apache or Gunicorn so you feel a more realistic enviroment while developing.

Categories