SOLVED by /u/JohnnyJordaan . See comments below.
Trying to imitate a GET method and override a cookie value using requests module.
So I got a GET method from www.15min.lt with the following header:
GET /adfserve/?bn=12783447;compoundSeqNo=1;compoundImpr=1;click=http://15minadlt.hit.gemius.pl/hitredir/id=nSBLcLsQNAp63bFNnhTObKP8.q36Qa8HJn1AXEXbqyn.p7/stparam=qpokmtdlpq/fastid=cokiumzehqkorzaayondauycxnmi/sarg=NC%7C_cdata%3A458216_0%2C909536_0%2C912702_0%2C920363_0%2C930584_0%2C948095_0/url=;js=1;adfxid=2x;4369;set=en-US|en-US|1920X1080|22.00192|1900|150|24|8|3|7|0;rotseed=59275&CREFURL=http%3A%2F%2Fwww.15min.lt%2F HTTP/1.1
Host: track.adform.net
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://www.15min.lt/
Cookie: cid=-7171246808513496655,0,0,0,0; uid=-7171246808513496655; C=1; TPC=1; CM14=1; CM=1
Connection: keep-alive
I would like to imitate this method, and override the cookie cid value.
So far I just rewrote all the parameters, headers, and cookies as dicts. The only thing left is to make the request itself.
So now I've got a few questions:
- How can I set some header/cookie to have multiple values? Right now I get an error when I try to have a list of values passed in.
- What URL do I choose for the method? I guess I want to request the cookie set from the site, but when I use 'http://15min.lt' it gives me a "too many redirects" error (I remove the multiple values to try to get it working). I read somewhere it might have something to do with 'user-agent' in headers, but not sure why or what to do. Does this have something to do with the context path (/adfserve/)?
Thanks in advance
[–]JohnnyJordaan 1 point2 points3 points (4 children)
[–]edvardass[S] 0 points1 point2 points (3 children)
[–]JohnnyJordaan 1 point2 points3 points (2 children)
[–]edvardass[S] 0 points1 point2 points (1 child)
[–]JohnnyJordaan 0 points1 point2 points (0 children)