I can't say I fully understand the script, because classes go beyond me as yet. Anyway, I've downloaded the py-omegle module from here . And I don't seem to be able to get it to run. Hoping that I don't need to post the whole class including functions, the part in particular that I'm having trouble with pertains to urllib2 - so I guess It's not too specific an issue - the line that causes all of the issues is:
self.connector = urllib2.build_opener(processor),urllib2.HTTPHandler(debuglevel=1)
and it's not letting me:
#omegle.py
[ln33] self.connector.addheaders = [
[ln34] ('User-agent',user_agent)
[ln35] ]
# or
[ln98] self.id = self.connector.open(self.url+'start',data={}).read().strip('"')
Both return AttributeError:
AttributeError: 'tuple' object has no attribute 'addheaders'
# and further down
AttributeError: 'tuple' object has no attribute 'open'
Could someone please explain how to fix this? I'm sure it has something to do with the first line I posted. The entire source of the ONLY file in this module can be accessed here.
I think it's a case of misplaced parentheses.
The first line:
self.connector = urllib2.build_opener(processor),urllib2.HTTPHandler(debuglevel=1)
creates a tuple consisting of
urllib2.build_opener(processor)
and
urllib2.HTTPHandler(debuglevel=1)
And then assigns this tuple to self.connector
.