#去哪儿网爬虫数据库配置信息
from peewee import *
import redis
#mysql
#db = MySQLDatabase("91jiafan", host="127.0.0.1", port=3306, user="root", password="123456")
m_HOST = "127.0.0.1"
m_USER = "root"
m_PASSWORD = "123456"
m_DB = "qunaer.com"
m_PORT = 3306
m_CHARSET = "utf-8"
#redis
#r=redis.Redis(host='58.221.24.242',port='18503',db='4',password=None,decode_responses=True)
r_HOST = "58.221.24.242"
r_PORT = "18503"
r_DB = "4"
r_PASSWORD = None
r_DECODE_RESPONSES = True
#mysql_db
db = MySQLDatabase(m_DB,host=m_HOST,port=m_PORT,user=m_USER,password=m_PASSWORD)
#redis_db
r=redis.Redis(host=r_HOST,port=r_PORT,db=r_DB,password=None,decode_responses=True)
# ODPS
ODPS_ID = "LTAIPyvGKEmu9cqu"
ODPS_KEY = "oNaAKmIVqeAqeJ9jnok3PHuv7r5bfo"
ODPS_PROJECT = "businessdata"
ODPS_ENDPOINT = "http://service.odps.aliyun.com/api"
#cookies datas
payload = "{\"b\":{\"bizVersion\":\"17\",\"cityUrl\":\" \",\"fromDate\":\" \",\"toDate\":\" \",\"q\":\"\",\"qFrom\":3,\"start\":0,\"num\":20,\"minPrice\":0,\"maxPrice\":-1,\"level\":\"\",\"sort\":0,\"cityType\":1,\"fromForLog\":1,\"uuid\":\"\",\"userName\":\"\",\"userId\":\"\",\"fromAction\":\"\",\"searchType\":0,\"hourlyRoom\":false,\"locationAreaFilter\":[],\"comprehensiveFilter\":[],\"channelId\":1},\"qrt\":\"h_hlist\",\"source\":\"website\"}"
headers = {
'authority': 'hotel.qunar.com',
'pragma': 'no-cache',
'cache-control': 'no-cache',
'accept': 'application/json, text/plain, */*',
'origin': 'https://hotel.qunar.com',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
'content-type': 'application/json;charset=UTF-8',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'referer': ' ',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
'cookie': 'QN1=00001b802e1827051e5021c6; HN1=v13682028f1bec89b222a940ba2fafd0dc; HN2=qnknsucsuccql; QN300=hotel.qunar.com; _i=ueHd86Mrat09otByUhkN1z6Cb4AX; QN269=1741D341D6C611EA8254FA163E26B699; fid=9d5930b9-43a0-493c-8391-cf3ddac5bc00; tabIndex=0; cityUrl= ; cityName= ; checkInDate= ; checkOutDate= ; QN205=organic; QN277=organic; csrfToken=yYUyq7lihjTg4w5pCvii6wJT2LcNNJmA; _vi=coXCle3GK8ahoVnqm_2CaN396kIu35THlLLmk00ID-mrOySO2TT96Kabmh8mvGTNUWBSsf9I0f_XiO5r2K-8hf_xqF6ixMCPX7rRUCxAtoa8MH8t76jaBnZwKtAmk0SKOF-FWykx1ZJ09fsoVtLtcwDwUIGIZA6au3qAcP263yJr; QN267=016181041823feb6fb; QN271=42eefa19-8b3d-401a-97b8-41fd9268de05; __qt=v1%7CVTJGc2RHVmtYMStSS2FBUXZBM1NRVGZ2dFRWbDZXQU1aNW1YOEI4bVUyL1RqT21RT21GbVo0ZFlZMEp4eWtQdHhGR0NsNmJ1R2c4V0R6aXFtcTRKcVZwa2VZbVY4YTBhMGJIUjlqNXZmMzZEbVo1R0s4UEFHN0JYZm1yVFRnd3Q3eDNxSCt5V0NZc3JJTnpSNmd2TFFRL2VaZm11bU9heWFZY1J1ZXlNV0FZPQ%3D%3D%7C1596707597357%7CVTJGc2RHVmtYMS9VUm4rYU8ybloybFl1WGxoRzRNUmg4YjVDdlpPOTF5b25yTDVlVGllZW1SelBqMmdGUC9VY3VIM0x4amZ0SDBOVTNRT2phTXhQYVE9PQ%3D%3D%7CVTJGc2RHVmtYMSs4VU9JYXFwd29zVHdUWWZteXNPUnlIUkd5RkRUVWtuKytvZGsxdVc5emIxZnI5K2tTN1RWS2xielVURlBCVE5TdWhtbEsxSFFlTlNaYjY1QSttQ0kybS9ZR05CUGFmRjFMTmVpdGVsVVIxZ2hSMkFtWGdha2dkcjlIRU84SC92V3A3MEd1c3JvcEJNQkQzV2ZXc1dkek9aY2lHS01jejY3TjI5OGZHWnBWT2FadVhNSWJ1eXd0SzMzMDZURlAxZkZpbUgvVE1VYXZpS1pBZURNS3FFeFR2RERmTFBPbkY1dkRGcHYxVnNYQ3lPK2UzL1BDaGlMRVJpSDhCRm5YQlB5ZWFxSFhQTVVkczg5L2Z3V2U2QVkxeWlIZHhMc08vVlg1bEFKV3JGU29VY0V1UXRQUEJucGduZzFDM0xEUWc1WlppZXBZdWh4RkxGVGtTanQ2SUtZelJqMU1kN2VQUUlTTzVIUmxyY3dFRE90TGsrcC84N01jZ3hQeVE3dmFvMDJjNlVWSnhYMEJ4a1c1VjRaY1JKMUw5bG9sdHgwV2ZrWURIdXBxMkliam44ZDlMVUZrenY5TU95S0ZKcENGaGxuRGluaHFmaGFTM0c5TE14Znllell6S0t0TkZPTjFKVzJmcGpiSSt2RU04NU4wRXNMZUE4ZTF4ZURHSGRrWDU1NWJPUVpNNWpyYnJuNzNhTW4vQS9WdlYzS2poUm4xYVVkVG1SR09CbS9XTFdlZkpOUHFWaTlDU1U5N3hkRWIrVi9aWXA5cDhwUU1mUG1xZVBZWTlwTjdyb2toQjA5M0c2YllJdXRwYzloT3JscTdpaTdLU0ZLd2VwekhDbk9oeGhBKzJnMmpYMUVjN1h1UkU0bXU2LzRJcHZoclVnRXQyRWs9'
}
url_hotel_api = "https://hotel.qunar.com/napi/list" # 此处为酒店参数获取入口请求url
# ADSL
NAME = "宽带连接",
USERNAME = "079109382221",
PASSWORD = "66668888"
#
#vacation_url = "https://dujia.qunar.com/golfz/routeList/adaptors/pcTop?isTouch=0&t=all&o=pop-desc&lm=0%2C60&fhLimit=0%2C60&q=%E4%B8%8A%E6%B5%B7&d=%E5%8D%97%E9%80%9A&s=all&qs_ts=1597025404801&tf=Ihot_02&ti=3&tm=l02&sourcepage=list&userResident=%E5%8D%97%E9%80%9A&random=749376&aroundWeight=1&qssrc=eyJ0cyI6IjE1OTcwMjU2OTU3NTIiLCJzcmMiOiJhbGwuZW52YyIsImFjdCI6InNjcm9sbCIsInJhbmRvbSI6IjM5NTUyIn0%3D&m=l%2CbookingInfo%2CbrowsingInfo%2Clm&displayStatus=pc&ddf=true&userId=00001b802e1827051e5021c6&hlFields=title&gpscity=%E5%8D%97%E9%80%9A&lines6To10=0"
vacation_payload = {}
vacation_headers = {
'authority': 'dujia.qunar.com',
'pragma': 'no-cache',
'cache-control': 'no-cache',
'accept': 'application/json, text/javascript, */*; q=0.01',
'x-requested-with': 'XMLHttpRequest',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'referer': 'https://dujia.qunar.com/pdqk/list_%E5%8D%97%E9%80%9A_%E9%81%B5%E4%B9%89_all?ti=3&tm=l01_all_search_newano',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
'cookie': 'DJ001=WyLljZfpgJoiXQ%3D%3D; QN1=00001b802e1827051e5021c6; HN1=v13682028f1bec89b222a940ba2fafd0dc; HN2=qnknsucsuccql; _i=ueHd86Mrat09otByUhkN1z6Cb4AX; QN269=1741D341D6C611EA8254FA163E26B699; fid=9d5930b9-43a0-493c-8391-cf3ddac5bc00; csrfToken=yYUyq7lihjTg4w5pCvii6wJT2LcNNJmA; QN300=auto_4e0d874a; QN99=1066; QN277=auto_4e0d874a; QN205=auto_4e0d874a; QunarGlobal=10.86.213.148_-ba9ffe3_173c6c832d4_-3d55|1596768404567; QN601=9502f35a4c69033ef0aa76a8bddcfc25; QN163=0; QN48=000030802f10271a34a878cb; QN6=auto_4e0d874a; QN49="64040021,57967441"; activityClose=1; JSESSIONID=1CA5D0A42A2B3F32FD0E60F15B881E96; _vi=f2Dh_DZGCGEMM1ExErF2xRPZXRDShBVIILyucEfMy1Cn8H46wGs6HGXyt3_coS1cg7QokPl1eVIVn25fmgQqJGdssYuntU5BWLkb3Hmw9YOhyAJ-XhSlIUYG5LB8TRZdxRKVHaT-g_BWxicZo4GkpDokzu49SzNQZ75KPD45QXii; QN100=WyLoi4%2Flt5585Y2X6YCaIiwi5LiK5rW3fCJd; QN271=a9a7bab2-3785-4e8d-b91a-354782f8ef72; QN267=0161810418d1168341; QN243=397; QN1=00001480319827120b981f99; QN300=hotel.qunar.com'
}
两年大概看此博客blog.codingnow.com/aee/