Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created November 13, 2015 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobian/3c0d8d1cfcc05683393e to your computer and use it in GitHub Desktop.
Save jacobian/3c0d8d1cfcc05683393e to your computer and use it in GitHub Desktop.
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