I have downloaded this file and can't run it. It keeps showing this error: enter image description here
I tried untab and tab it again, put the tab length to 4 and 8 but nothing changes :( Please help
from fbchat import Client, log
from getpass import getpass
from datetime import datetime
import sys, os, urllib, time, socket, shutil, requests
from glob import glob
from zipfile import ZipFile
socket.setdefaulttimeout(60)
reload(sys)
sys.setdefaultencoding("utf-8")
ending = '</div></div>'
username = str(raw_input("Username: "))
password = getpass()
client = Client(username, password)
zipping = str(raw_input("Want to save your data as a .Zip file y/n?: "))
uid = client.uid
USER = client.fetchUserInfo(client.uid)[client.uid]
self = USER.name
ID = []
NAME = []
docs = ['docx', 'doc', 'pdf', 'pptx', 'txt', 'xlsx']
media = ['mp3', 'mp4', 'aac', 'webm', 'avi', '3gp']
gen = ['jpg', 'png']
def download_file(add, name):
request = requests.get(add, timeout=60, stream=True)
#Open the output file and make sure we write in binary mode
flag = 0
with open(name, 'wb') as fh:
# Walk through the request response in chunks of 1024 * 1024 bytes, so 1MiB
for chunk in request.iter_content(1024 * 1024):
# Write the chunk to the file
flag += 1
if flag > 10:
Log_file.write("This file is bigger than 10MB so download it if you want-- " + add + '\n\n')
break
fh.write(chunk)