Created
December 21, 2016 09:50
-
-
Save plu/d28763bbe0313922adf936079e217b3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from mitmproxy import ctx | |
from mitmproxy.models import decoded | |
import codecs | |
import json | |
class Duolingo: | |
def response(self, flow): | |
if "/api/1/version_info" not in flow.request.url: | |
return | |
data = json.loads(flow.response.content.decode('utf-8')) | |
data["supported_directions"]["en"] = data["supported_directions"]["en"] + ["ro"] | |
flow.response.content = str.encode(json.dumps(data)) | |
def start(): | |
return Duolingo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment