Created
November 13, 2015 16:04
-
-
Save jacobian/3c0d8d1cfcc05683393e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
class Lanyrd(requests.Session): | |
def __init__(self, *args, **kwargs): | |
super(Lanyrd, self).__init__(*args, **kwargs) | |
self.headers.update({ | |
'X-Lanyrd-Auth': str(time.time()), | |
'User-Agent': 'Lanyrd-iOS/2.4.0 (iPhone OS 6.1.3; iPhone5,2 N42AP) build/61', | |
'X-Lanyrd-Protocol': '4', | |
'X-Lanyrd-Hardware': "320x568@2", | |
'X-Lanyrd-DeviceID': "Device-String", | |
'X-Lanyrd-PushEnvironment': "ios-production", | |
'x-mycustomurl-intercept': "api", | |
}) | |
def request(self, method, url, *args, **kwargs): | |
if '://' not in url: | |
url = 'http://lanyrd.com/mobile/ios2/' + url.lstrip('/') | |
return super(Lanyrd, self).request(method, url, *args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment