# Start script

**URL:** <https://discourse.mitmproxy.org/t/start-script/999>\
**Category:** Uncategorized\
**Created:** [April 20, 2018, 4:46pm UTC](https://discourse.mitmproxy.org/t/start-script/999 "2018-04-20T16:46:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben.moreno](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@Ben.moreno](https://discourse.mitmproxy.org/u/Ben.moreno)\
**Post date:** [April 20, 2018, 4:46pm UTC](https://discourse.mitmproxy.org/t/start-script/999/1 "2018-04-20T16:46:10Z")

</div>

Hello guys! I try to start a script and implement a new pictures to websites and rotate them, can you please have a look and see if its correct?  
#! /usr/bin/Python3

# modify\_response.py

import sys  
import os  
from io import StringIO  
from mitmproxy.net.http import encoding  
from mitmproxy.net.http import headers  
from [mitmproxy.net](http://mitmproxy.net) import http  
from PIL.Image import core as \_imaging  
from PIL.Image import Image  
def response(flow):  
if flow.response.headers.get(“content-type”, “”).startswith(“img”):  
img = open(“140615222725.png”, “rb”).read()  
img = Image.open(“140615222725.png”)  
img.rotate(90).show()  
flow.response.content = img  
flow.response.headers[“content-type”] = “image/png”
