12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915 |
- import concurrent.futures
- import requests
- from concurrent.futures import ThreadPoolExecutor, as_completed
-
- from sqlalchemy import Column,String,create_engine
- #,event
- from sqlalchemy.orm import sessionmaker
- from sqlalchemy.ext.declarative import declarative_base
- import pyodbc
-
- import pandas as pd
- import numpy as np
- import csv
-
-
-
- import requests
- import json
- import rsa
- import binascii
- import json
- import csv
- import pandas as pd
- import datetime
- import random
- import sys
- import time
- from bs4 import BeautifulSoup
- import re
- from PyQt5.QtCore import QThread, pyqtSignal
- from PyQt5.QtWidgets import (QApplication, QDialog,
- QProgressBar, QPushButton,QLabel)
- from PyQt5 import QtWidgets
- from PyQt5.QtCore import *
- from sqlalchemy import Column,String,create_engine
- from sqlalchemy.orm import sessionmaker
- from sqlalchemy.ext.declarative import declarative_base
- import pyodbc
- import os
- import logging
- import traceback
-
-
- import atexit
- FORMAT = '%(asctime)s %(levelname)s: %(message)s'
- logging.basicConfig(level=logging.INFO, filename='myLog.log', filemode='w', format=FORMAT)
-
-
- Base = declarative_base()
- class Logdata(Base):
- __tablename__ = 'LOGDB'
-
- 資料庫 = Column(String(20), primary_key=True)
- IP位置 = Column(String(20))
- 帳號 = Column(String(20))
- 密碼 = Column(String(20))
- class User(Base):
-
- __tablename__ = '客戶資料表'
-
- 客戶 = Column(String(20), primary_key=True)
- 資料庫 = Column(String(20))
- IP位置 = Column(String(20))
- 帳號 = Column(String(20))
- 密碼 = Column(String(20))
- class DateF(Base):
- __tablename__ = '查詢時間'
-
- 開始=Column(String(20), primary_key=True)
- 結束=Column(String(20))
- 是否全導=Column(String(20))
- class Someoneupdate(Base):
- __tablename__ = '自動導入判斷'
- 正在自動導入中= Column(String(20), primary_key=True)
-
- def loadCSV():
- try:
- with open('000.csv', newline='') as csvfile:
-
- rows = csv.reader(csvfile)
- csvvrow=[]
- for row in rows:
- csvvrow.append(row)
- coustomtxt=(csvvrow[1][0])
- bdtxtcrypto=(csvvrow[2][0])
-
- #====================================解密==========================
- PRIVATTTTT=693199020841184529005187339596013597950466957598599888793608033530271219415853952414609432155441426597962873618644988823224505129033188472492232565627111731743840442387622658441932249274048207290194890312931801018119336565101207159089093817844379836520246765598761731093447853178093855957965143730121353938159096214435813116478583463281838568325696377260624492699103838269489173425735163766515881745838239102851526971498900537039965925229366981233886305256752613857576375123305107336285923247046744901857058559811348110224118414002814652550587381981742663420856507553321403129123387307759852585845583253705194423896104474967966535066409675943348475929657759428664521337873475544406762447015072876289975051669953965932555224693025757002523361150649200905802416556626834350633483715061798581642291839762255979334372982156774414505811030453728205541010293992016524698689810201483053731487961892768615175941360043106707261541518852778287823654935902238415934276399863697899069150965902889645358960710613979521286008786269668237598187906056491031301559442316212834296436205439154886053776090316790598915161638161668892006476380622662058436463540372859165165728327478177043147902958378365406901451035507793539047616182219516942468776336379
- #PrivateKey
- A1=435136098972877768874748645248339158125703956065257805897130489515873898645785064137580564100320503666838498219287367368030775233887671705599248600291953393231454780648861079171195672717473628632853618453449217420455794237632155291175461656351373149436294485404694429947256530385791280349340495413483412113186857182441596591220416636342090069157129915377951859333634936029548424638926391232291634636038258059603109206715187896810765799441703590963590776385210580000409455669280693512175818186066741512695081131148497030784289903926969375944559780083722346620544362180693184053719440253987062360057770451705216722616373945761278697477867656454308042535057052004210508850990364826097246310462235289453838547367442863138161099765610183693493835956264409463595891562624222255540841617618186384919177648960630843478742501992844305124096538648231123014949030890404247398161443680124720970242595119682693770042136274011065565273819531541118246115073819134261046370918950429149073365625538812772489582690787721407799409054150416184648077711942774002489730938839028835996373562349388498470086161265863994312489374464512279091382150353090705188164569282723516063722137626802108564462453248942121100848000690940344201632450119420978307322308945
- A2=9627714051932950193134188501742994592784042206914443459734438308841410040354738469881718445461422881776007294906803790685427277699734850787185938262102876531473114260174800542552232307443022494368143100728406826855674366796656059054215802558213346170105688323652674928367680251460924362233864869984871966783909100785712414620921144535418728448391075664442600744983428543175164409720230286595771434578391588137898216407341812591598354427012529961000712417819821596260309468611766323842906019082923549785615976305556417630687246871293866806059225782724368215141401076633953519395967986211659258251543120569378038365122086876706827618666557619122782700896147
- A3=72000374865933143340744306653169834428832683081115110740204100237805467875781399111076588189449270231784547205065314993551385284482420372845976820023615822918370850049018336485262561074750111640775157594829249815372287322731748252778906894672575675394415480712584447066603079224388770970172603768779881242086210954654794512868330782099170594476257989194451530266257956383540560124814995186866139904562390161487741092810396910518052928540664299189962055810713116703112503213279177866017925218355080344908808970420740591501342146164000394175136511345019472809580649061686926648057
- bdtxtcrypto=bdtxtcrypto.encode('utf8')
- print(bdtxtcrypto)
- print(type(bdtxtcrypto))
- bdtxtcrypto=binascii.a2b_hex(bdtxtcrypto)
- mmmmm=rsa.decrypt(bdtxtcrypto,rsa.PrivateKey(PRIVATTTTT,65537,A1,A2,A3))
- bdtxt=(mmmmm.decode('utf8'))
- #====================================解密==========================
-
- return coustomtxt,bdtxt
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app1 = QtWidgets.QApplication([])
-
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('無法取得000.csv')
-
- app1.exec_()
- def connectEngine(coustomtxt,engine):
- try:
- DB_session = sessionmaker(engine)
- db_session = DB_session()
- comDbUserData=db_session.query(User).filter(User.客戶.like(coustomtxt)).all()
-
- UserDbName=comDbUserData[0].資料庫
- UserIPName=comDbUserData[0].IP位置
- UserAdName=comDbUserData[0].帳號
- UserPdName=comDbUserData[0].密碼
-
- engine3 = create_engine('mssql+pyodbc://'+UserAdName+':'+UserPdName+'@'+UserIPName+'/'+UserDbName+'?driver=SQL+Server+Native+Client+11.0',fast_executemany=True)
- # engine3 = create_engine('mssql+pyodbc://'+UserAdName+':'+UserPdName+'@'+UserIPName+'/'+UserDbName+'?driver=SQL+Server+Native+Client+11.0')
- return engine3
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('資料連線失敗')
- app1.exec_()
- def DateDataLoad(engine3,db_session2):
- try:
- #engine3=connectEngine()
-
- Datefind=db_session2.query(DateF).all()
- startdatekey=Datefind[0].開始
- enddatekey=Datefind[0].結束
- allpart=Datefind[0].是否全導
- return startdatekey,enddatekey,allpart
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('導入日期資料失敗')
- app1.exec_()
- def LoadCustomData(engine3,allpart):
- try:
- #editim = "CC1,CC2,CC3,CC4,CC5,CC6,CC7,CC8,CC9,CC10,CC11,CC12,CC13,CC14,CC15,CC16,CC17,CC18,CC19,CC20,CC21,CC22,CC23,CC24,CC25,CC26,CC27,CC28,CC29,CC30,CC31,CC32,CC33,CC34,CC35,CC36,CC37,CC38"
- if thisfile=="A1.txt":
- if (allpart=="0"):
- #有外埔 ca5-mfr7.cm589.net 28ss
- #無外補 c39-4gb93.cw8889.net top009
- #ca1-k92xt.cm589.net
- #kk155
- #pos1.2b598.net
- #)"#
- #www.bb5858.net
- #ku01
- #aa8888
- #www.fpk357.com
- #wa.jar199.com
- #168aq
- text3="SELECT TOP(1000) 網址, 帳號, 密碼 ,備用網址 FROM 商客基本資料表 WHERE (上一層='0')"# and 網址='mm.3g688.net' and 帳號='kg06')"
- #text4="SELECT TOP(1000) "+editim+" FROM 商客基本資料表 WHERE (上一層='0')"# and 網址='w3a.fuu588.com' and 帳號='s013')"
- CA_SQL="SELECT TOP(1000) 網址, 帳號, 主帳號 ,備用網址 FROM 商客基本資料表 WHERE (上一層='1')"# and 網址='mm.3g688.net' and 帳號='kg06')"
- else:
- text3="SELECT TOP(1000) 網址, 帳號, 密碼 ,備用網址 FROM 商客資料暫存檔 WHERE (上一層='0')"# and 網址='c56-gdmc.ck9998.net' and 帳號='kk98')"
- #text4="SELECT TOP(1000) "+editim+" FROM 商客基本資料表 WHERE (上一層='0')"# and 網址='c56-gdmc.ck9998.net' and 帳號='kk98')"
- CA_SQL="SELECT TOP(1000) 網址, 帳號, 主帳號 ,備用網址 FROM 商客資料暫存檔 WHERE (上一層='1')"# and 網址='c56-gdmc.ck9998.net' and 帳號='kk98')"
-
- elif thisfile=="A2.txt":
- if (allpart=="0"):
- text3="SELECT TOP(1000) 網址, 帳號, 密碼 ,備用網址 FROM 後台商客基本資料表 WHERE (上一層='0')"# and 網址='w1a.85vvip.com' and 帳號='vv09')"
- #text4="SELECT TOP(1000) "+editim+" FROM 商客基本資料表 WHERE (上一層='0')"# and 網址='www.jjj539.com' and 帳號='28ss')"
- CA_SQL="SELECT TOP(1000) 網址, 帳號, 主帳號 ,備用網址 FROM 後台商客基本資料表 WHERE (上一層='1')"# and 網址='w1a.85vvip.com' and 帳號='vv09')"
- else:
- text3="SELECT TOP(1000) 網址, 帳號, 密碼 ,備用網址 FROM 後台商客資料暫存檔 WHERE (上一層='0')"# and 網址='w1a.85vvip.com' and 帳號='vv09')"
- #text4="SELECT TOP(1000) "+editim+" FROM 商客基本資料表 WHERE (上一層='0')"# and 網址='www.jjj539.com' and 帳號='28ss')"
- CA_SQL="SELECT TOP(1000) 網址, 帳號, 主帳號 ,備用網址 FROM 後台商客資料暫存檔 WHERE (上一層='1')"# and 網址='w1a.85vvip.com' and 帳號='vv09')"
- loopper2=pd.read_sql(text3,engine3)
- childAdminLs=pd.read_sql(CA_SQL,engine3)
- asd = np.ones((1, 38), dtype=bool)
- loopper3=pd.DataFrame(asd)
- print(loopper3)
- contforloop=len(loopper2)
- loopper2=loopper2.values
- loopper3=loopper3.values
- print(loopper3)
- childAdminLs=childAdminLs.values
- print(loopper2)
- print(len(loopper3[0]))
- if thisfile=="A2.txt":
- x=0
- while x != len(loopper3[0]):
- loopper3[0][x] = True
- x+=1
- print(loopper3)
- return contforloop,loopper2,childAdminLs,loopper3
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('無基本資料')
- app1.exec_()
- def CreateLogEngine():
- try:
- DB_session_log = sessionmaker(engine)
- db_session_log= DB_session_log()
- Log_database=db_session_log.query(Logdata).all()
-
- LogDbName=Log_database[0].資料庫
- LogIPName=Log_database[0].IP位置
- LogAdName=Log_database[0].帳號
- LogPdName=Log_database[0].密碼
-
- log_Engine=create_engine('mssql+pyodbc://'+LogAdName+':'+LogPdName+'@'+LogIPName+'/'+LogDbName+'?driver=SQL+Server+Native+Client+11.0')
- return log_Engine
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('記錄連線失敗')
- app1.exec_()
- def LongFirstLogin(urlkey,adminkey,passkey):
- try:
- #===========================================================網站需要的加密
- print(urlkey)
- pubkey="B0C1D0E12B47DA93A24C7422D433170A4D5B126A27CED6F3087652723562889803E2280041F02E6B24A251C928EBE5BA12501D466D63A43AD5D88A5809A09271F14FD220C0DAE272CAAF9F1CF09DAF52005272529071723C0CB87B5A6392860CA2E72B23A4652910DB87BAC31D89E4DD23B3C56AAE685D9A14C4CC89862AAA27"
- rsaPublickey = int(pubkey,16)
- key = rsa.PublicKey(rsaPublickey,65537)
- message='{\"Account\":\"'+adminkey+'\",\"Password\":\"'+passkey+'\"}'
- message=message.encode('utf8')
- #passwd = rsa.encrypt(message,key)
- passwd = binascii.b2a_hex(rsa.encrypt(message,key)).decode()
- #=========================================================================
-
- Loginurl="http://"+urlkey+"/api/shared/login"
- headers1 = {
- 'Content-Length': '256',
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- print(passwd)
- response = requests.request("POST", Loginurl, headers=headers1, data=passwd, timeout=12,verify=False)
-
- return response
- except Exception as e:
- print("发生异常:", e)
- response="無法取得資料"
- return response
- def LongSecondLogin(LFLresponse):
- try:
- LFLresponseJson=json.loads(LFLresponse.text)
- print("LFLresponseJson:"+str(LFLresponseJson))
- SecondLoginUrl=LFLresponseJson['Redirect']
- SecondLoginData=LFLresponseJson['Data']
-
- headers2 = {
- 'Content-Length': '514',
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- print(SecondLoginUrl)#debug
- GatewayUrl="http:"+SecondLoginUrl
- print("GatewayUrl"+GatewayUrl)
- LoginGatewayPostData="+="+SecondLoginData
- response2 = requests.request("POST", GatewayUrl, headers=headers2, data=LoginGatewayPostData, timeout=12,verify=False)
- return SecondLoginUrl,SecondLoginData,response2
- except:
- SecondLoginUrl=""
- SecondLoginData=""
- response2=""
- return SecondLoginUrl,SecondLoginData,response2
-
- def LongGetData(urlkey, adminkey, passkey, startDatekey, endDatekey,backupUrl,childAdminLs):
- print("URLLLLLLLLLLLLLL:"+str(urlkey))
- try:
- LFLresponse=LongFirstLogin(urlkey,adminkey,passkey)#第一層登入
- if LFLresponse=="無法取得資料":
- urlkey=backupUrl#使用備用網址
- LFLresponse=LongFirstLogin(urlkey,adminkey,passkey)
- if LFLresponse=="無法取得資料":
- fordebugger="無法取得資料"
- allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
- print("LFLresponsestatus_code"+str(LFLresponse.status_code))
- if LFLresponse.status_code==200:
- SecondLoginUrl,SecondLoginData,LSLresponse=LongSecondLogin(LFLresponse)#第一層登入成功 登入第2層
- if LSLresponse=="":
- print('我從這邊出去的')
- allll,fordebugger,urlkey,adminkey=ShortGetData(urlkey, adminkey, passkey, startDatekey, endDatekey,childAdminLs)
- #fordebugger="無法取得資料"
- #allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
- else:
- getnameurl = "http:"+SecondLoginUrl[:-21]+"/Admin/D/D02"
- cookie=LSLresponse.cookies
- cookie=dict(cookie)['ASP.NET_SessionId']
- #print("cookie:"+str(cookie))
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/AdminD02Report1/MainQuery"#-21=-(/Command/LoginGateway)
- cookstring="ASP.NET_SessionId="+cookie
- headers88 = {
- 'X-Requested-With': 'XMLHttpRequest',
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Cookie': cookstring,
- }
- response4 = requests.request("GET", getnameurl, headers=headers88, timeout=12,verify=False)
- print("response4status_code"+str(response4.status_code))
- if response4.status_code != 200:
- getnameurl = "http:"+SecondLoginUrl[:-21]+"/Front/A/A08"
- response4 = requests.request("GET", getnameurl, headers=headers88, timeout=12,verify=False)
- print(response4.status_code)
- #print("respons4444444"+response4.text)
- soup3=BeautifulSoup(response4.text,"lxml")
- pattern = re.compile(r'Name:"(.*?)"',re.MULTILINE|re.DOTALL)
- #print(pattern)
- script = soup3.find("script", text=pattern)
- #print("SCRIPTTTTT:::::"+str(script))
- matches = re.finditer(r'Name:"(.*?)"', script.string, re.MULTILINE)
- matchend=[]
- badmatchend= ["單碰","配比包牌","雙面包牌","連碰","柱碰","一比四","套餐","連柱碰","雙星連碰柱","三星連碰柱","雙連碰"]
- for matchNum, match in enumerate(matches, start=1):
- #print ("在{start}-{end}找到匹配{matchNum}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
- for groupNum in range(0, len(match.groups())):
- groupNum = groupNum + 1
- if match.group(groupNum) not in matchend and match.group(groupNum) not in badmatchend:
- matchend.append(match.group(groupNum))
- #print ("在{start}-{end}找到组{groupNum}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
- print(matchend)
- print(loopper3)
- getData3 = ""
- if len(loopper3) > 0:
- if '迦納彩' in matchend and loopper3[0][37] == True:
- getData3 += "&GameType%5B%5D=35"
- #if '加州彩' in matchend and loopper3[0][34] == True:
- # getData3 += "&GameType%5B%5D=35"
- if '天天樂' in matchend and loopper3[0][6] == True:
- getData3 += "&GameType%5B%5D=22"
- if '威力' in matchend and loopper3[0][5] == True:
- getData3 += "&GameType%5B%5D=14"
- if '539' in matchend and loopper3[0][4] == True:
- getData3 += "&GameType%5B%5D=13"
- if '大樂' in matchend and loopper3[0][3] == True:
- getData3 += "&GameType%5B%5D=12"
- if '六合' in matchend and loopper3[0][2] == True:
- getData3 += "&GameType%5B%5D=11"
- if '三星彩' in matchend and loopper3[0][1] == True:
- getData3 += "&GameType%5B%5D=3"
- if '四星彩' in matchend and loopper3[0][0] == True:
- getData3 += "&GameType%5B%5D=2"
- if '十二不中' in matchend and loopper3[0][24] == True:
- getData3 += "&GroupType%5B%5D=160"
- if '十一不中' in matchend and loopper3[0][23] == True:
- getData3 += "&GroupType%5B%5D=159"
- if '十不中' in matchend and loopper3[0][22] == True:
- getData3 += "&GroupType%5B%5D=158"
- if '九不中' in matchend and loopper3[0][21] == True:
- getData3 += "&GroupType%5B%5D=157"
- if '八不中' in matchend and loopper3[0][20] == True:
- getData3 += "&GroupType%5B%5D=156"
- if '七不中' in matchend and loopper3[0][19] == True:
- getData3 += "&GroupType%5B%5D=155"
- if '六不中' in matchend and loopper3[0][18] == True:
- getData3 += "&GroupType%5B%5D=154"
- if '五不中' in matchend and loopper3[0][17] == True:
- getData3 += "&GroupType%5B%5D=153"
- if '五星' in matchend and loopper3[0][16] == True:
- getData3 += "&GroupType%5B%5D=118"
- if '天碰三' in matchend and loopper3[0][15] == True:
- getData3 += "&GroupType%5B%5D=109"
- if '天碰二' in matchend and loopper3[0][14] == True:
- getData3 += "&GroupType%5B%5D=108"
- if '四星' in matchend and loopper3[0][13] == True:
- getData3 += "&GroupType%5B%5D=107"
- if '三星' in matchend and loopper3[0][12] == True:
- getData3 += "&GroupType%5B%5D=106"
- if '二星' in matchend and loopper3[0][11] == True:
- getData3 += "&GroupType%5B%5D=105"
- if '特尾三' in matchend and loopper3[0][10] == True:
- getData3 += "&GroupType%5B%5D=104"
- if '台號' in matchend and loopper3[0][9] == True:
- getData3 += "&GroupType%5B%5D=103"
- if '特碼' in matchend and loopper3[0][8] == True:
- getData3 += "&GroupType%5B%5D=102"
- if '全車' in matchend and loopper3[0][7] == True:
- getData3 += "&GroupType%5B%5D=101"
- if '合單雙' in matchend and loopper3[0][33] == True:
- getData3 += "&GroupType%5B%5D=9"
- if '四字現' in matchend and loopper3[0][32] == True:
- getData3 += "&GroupType%5B%5D=8"
- if '三字現' in matchend and loopper3[0][31] == True:
- getData3 += "&GroupType%5B%5D=7"
- if '二字現' in matchend and loopper3[0][30] == True:
- getData3 += "&GroupType%5B%5D=6"
- if '一字現' in matchend and loopper3[0][29] == True:
- getData3 += "&GroupType%5B%5D=5"
- if '四定位' in matchend and loopper3[0][28] == True:
- getData3 += "&GroupType%5B%5D=4"
- if '三定位' in matchend and loopper3[0][27] == True:
- getData3 += "&GroupType%5B%5D=3"
- if '二定位' in matchend and loopper3[0][26] == True:
- getData3 += "&GroupType%5B%5D=2"
- if '一定位' in matchend and loopper3[0][25] == True:
- getData3 += "&GroupType%5B%5D=1"
- print(getData3)
- print(getData3.find("GameType"))
- getData= "Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
-
- #====================================種類=================================
- #getData="Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- #getData= "Account=&GameType%5B%5D=35&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- if response3.status_code!=200:
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/FrontA08Report1/MainQuery"#-21=-(/Command/LoginGateway)
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- #print(response3)
- print("AAAAA0")
- if response3.status_code==200:
- jsondata=json.loads(response3.text)
- print("AAAAA1")
- #print(jsondata)
- if response3.text=="null":
- getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA7")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA2")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account=&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- #responsetxt=response3.text
- #print(responsetxt)
- print("AAAAA3")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA4")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA5")
- if response3.text=="null":
- #getData="Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- getData="Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA8")
- jsondata=json.loads(response3.text)
- print(jsondata)
- print("AAAAA6")
- #====================================種類=========================================
- #====================================解析資料=====================================
- allll=[]
- if len(jsondata['DataList'])>0:
- #print(len(jsondata['DataList']))
- #print(jsondata['DataList'])
- #print(jsondata['DataList'][0]['NickName'])
- for i in range(len(jsondata['DataList'])):
- allll.append([])
- allll[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- allll[i].append(jsondata['DataList'][i]['TotBet'])
- allll[i].append(jsondata['DataList'][i]['TotBetRebate'])
- allll[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- allll[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- if len(jsondata['DataList'][i]['ContributionPaid']) >7:
- for j in range(7):
- allll[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- else:
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- allll[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- allll[i].append(None)
- allll[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- allll[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- allll[i].append(jsondata['DataList'][i]['TotPaid'])
- allll[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- try:
- allll[i].append(jsondata['DataList'][i]['PaidContributor'])
- except:
- allll[i].append(None)
- allll[i].append(jsondata['DataList'][i]['TotContribution'])
- allll[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- try:
- allll[i].append(jsondata['DataList'][i]['TotControl'])
- except:
- allll[i].append(None)
- try:
- allll[i].append(jsondata['DataList'][i]['TotControlDuty'])
- except:
- allll[i].append(None)
- try:
- allll[i].append(jsondata['DataList'][i]['SystemDuty'])
- except:
- allll[i].append(None)
- print(allll)
- allll=pd.DataFrame(allll)
- allll.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- allll=pd.DataFrame()
- fordebugger="查詢期間無資料"
- #=================================解析資料=============================================
- #================================插入資訊==============================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- nowTime=datetime.datetime.now().strftime("%m%d%H%M%S")
- randomNum=random.randint(0,10000)
- if randomNum<10:
- randomNum=str(0)+str(0)+str(0)+str(randomNum)
- elif randomNum>10 and randomNum<100:
- randomNum=str(0)+str(0)+str(randomNum)
- elif randomNum>100 and randomNum<1000:
- randomNum=str(0)+str(randomNum)
- uniqueNum=str(nowTime)+str(randomNum)
- for i in range(len(allll)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append("全")
- allll.insert(0,"開始日期",StartDATETXT)
- allll.insert(1,"結束日期",EndDATETXT)
- allll.insert(2,"網址",WEBURLTXT)
- allll.insert(3,"帳戶",ADMINTXT)
- allll.insert(4,"隨機碼",TIMERAND)
- print(allll)
- #=====================================================================================
- refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- allll=pd.concat([refind,allll],ignore_index = True)
- end = time.time()
- print("執行時間:%f 秒" % (end - start))
- """
- if thisfile=="A2.txt":
- getData3 = ""
- if '大樂' in matchend :
- getData3 += "&GameType%5B%5D=12"
- if '十二不中' in matchend :
- getData3 += "&GroupType%5B%5D=160"
- if '十一不中' in matchend :
- getData3 += "&GroupType%5B%5D=159"
- if '十不中' in matchend :
- getData3 += "&GroupType%5B%5D=158"
- if '九不中' in matchend :
- getData3 += "&GroupType%5B%5D=157"
- if '八不中' in matchend :
- getData3 += "&GroupType%5B%5D=156"
- if '七不中' in matchend :
- getData3 += "&GroupType%5B%5D=155"
- if '六不中' in matchend :
- getData3 += "&GroupType%5B%5D=154"
- if '五不中' in matchend :
- getData3 += "&GroupType%5B%5D=153"
- if '五星' in matchend :
- getData3 += "&GroupType%5B%5D=118"
- if '天碰三' in matchend :
- getData3 += "&GroupType%5B%5D=109"
- if '天碰二' in matchend :
- getData3 += "&GroupType%5B%5D=108"
- if '四星' in matchend :
- getData3 += "&GroupType%5B%5D=107"
- if '三星' in matchend :
- getData3 += "&GroupType%5B%5D=106"
- if '二星' in matchend :
- getData3 += "&GroupType%5B%5D=105"
- if '特尾三' in matchend :
- getData3 += "&GroupType%5B%5D=104"
- if '台號' in matchend :
- getData3 += "&GroupType%5B%5D=103"
- if '特碼' in matchend :
- getData3 += "&GroupType%5B%5D=102"
- if '全車' in matchend :
- getData3 += "&GroupType%5B%5D=101"
- if '合單雙' in matchend:
- getData3 += "&GroupType%5B%5D=9"
- if '四字現' in matchend :
- getData3 += "&GroupType%5B%5D=8"
- if '三字現' in matchend :
- getData3 += "&GroupType%5B%5D=7"
- if '二字現' in matchend :
- getData3 += "&GroupType%5B%5D=6"
- if '一字現' in matchend :
- getData3 += "&GroupType%5B%5D=5"
- if '四定位' in matchend :
- getData3 += "&GroupType%5B%5D=4"
- if '三定位' in matchend :
- getData3 += "&GroupType%5B%5D=3"
- if '二定位' in matchend :
- getData3 += "&GroupType%5B%5D=2"
- if '一定位' in matchend :
- getData3 += "&GroupType%5B%5D=1"
- getData= "Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- if response3.status_code!=200:
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/FrontA08Report1/MainQuery"#-21=-(/Command/LoginGateway)
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- #print(response3)
- print("AAAAA0")
- if response3.status_code==200:
- jsondata=json.loads(response3.text)
- print("AAAAA1")
- #print(jsondata)
- if response3.text=="null":
- getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA7")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA2")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account=&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- #responsetxt=response3.text
- #print(responsetxt)
- print("AAAAA3")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA4")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA5")
- if response3.text=="null":
- #getData="Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- getData="Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("AAAAA8")
- jsondata=json.loads(response3.text)
- #print(jsondata)
- print("AAAAA6")
- #====================================種類=========================================
- #====================================解析資料=====================================
- allll2=[]
- if len(jsondata['DataList'])>0:
- #print(len(jsondata['DataList']))
- #print(jsondata['DataList'])
- #print(jsondata['DataList'][0]['NickName'])
- for i in range(len(jsondata['DataList'])):
- allll2.append([])
- allll2[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- allll2[i].append(jsondata['DataList'][i]['TotBet'])
- allll2[i].append(jsondata['DataList'][i]['TotBetRebate'])
- allll2[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- allll2[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- allll2[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- allll2[i].append(None)
- allll2[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- allll2[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- allll2[i].append(jsondata['DataList'][i]['TotPaid'])
- allll2[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- try:
- allll2[i].append(jsondata['DataList'][i]['PaidContributor'])
- except:
- allll2[i].append(None)
- allll2[i].append(jsondata['DataList'][i]['TotContribution'])
- allll2[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- try:
- allll2[i].append(jsondata['DataList'][i]['TotControl'])
- except:
- allll2[i].append(None)
- try:
- allll2[i].append(jsondata['DataList'][i]['TotControlDuty'])
- except:
- allll2[i].append(None)
- try:
- allll2[i].append(jsondata['DataList'][i]['SystemDuty'])
- except:
- allll2[i].append(None)
- print(allll2)
- allll2=pd.DataFrame(allll2)
- allll2.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- allll2=pd.DataFrame()
- fordebugger="查詢期間無資料"
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- nowTime=datetime.datetime.now().strftime("%m%d%H%M%S")
- randomNum=random.randint(0,10000)
- if randomNum<10:
- randomNum=str(0)+str(0)+str(0)+str(randomNum)
- elif randomNum>10 and randomNum<100:
- randomNum=str(0)+str(0)+str(randomNum)
- elif randomNum>100 and randomNum<1000:
- randomNum=str(0)+str(randomNum)
- uniqueNum=str(nowTime)+str(randomNum)
- for i in range(len(allll2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append("大")
- allll2.insert(0,"開始日期",StartDATETXT)
- allll2.insert(1,"結束日期",EndDATETXT)
- allll2.insert(2,"網址",WEBURLTXT)
- allll2.insert(3,"帳戶",ADMINTXT)
- allll2.insert(4,"隨機碼",TIMERAND)
- print(allll2)
- #=====================================================================================
- refind2=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- allll2=pd.concat([refind2,allll2],ignore_index = True)
- allll=pd.concat([allll,allll2],ignore_index = True)
- if thisfile=="A2.txt":
- getData3 = ""
- if '六合' in matchend:
- getData3 += "&GameType%5B%5D=11"
- if '十二不中' in matchend :
- getData3 += "&GroupType%5B%5D=160"
- if '十一不中' in matchend :
- getData3 += "&GroupType%5B%5D=159"
- if '十不中' in matchend :
- getData3 += "&GroupType%5B%5D=158"
- if '九不中' in matchend :
- getData3 += "&GroupType%5B%5D=157"
- if '八不中' in matchend :
- getData3 += "&GroupType%5B%5D=156"
- if '七不中' in matchend :
- getData3 += "&GroupType%5B%5D=155"
- if '六不中' in matchend :
- getData3 += "&GroupType%5B%5D=154"
- if '五不中' in matchend :
- getData3 += "&GroupType%5B%5D=153"
- if '五星' in matchend :
- getData3 += "&GroupType%5B%5D=118"
- if '天碰三' in matchend :
- getData3 += "&GroupType%5B%5D=109"
- if '天碰二' in matchend :
- getData3 += "&GroupType%5B%5D=108"
- if '四星' in matchend :
- getData3 += "&GroupType%5B%5D=107"
- if '三星' in matchend :
- getData3 += "&GroupType%5B%5D=106"
- if '二星' in matchend :
- getData3 += "&GroupType%5B%5D=105"
- if '特尾三' in matchend :
- getData3 += "&GroupType%5B%5D=104"
- if '台號' in matchend :
- getData3 += "&GroupType%5B%5D=103"
- if '特碼' in matchend :
- getData3 += "&GroupType%5B%5D=102"
- if '全車' in matchend :
- getData3 += "&GroupType%5B%5D=101"
- if '合單雙' in matchend:
- getData3 += "&GroupType%5B%5D=9"
- if '四字現' in matchend :
- getData3 += "&GroupType%5B%5D=8"
- if '三字現' in matchend :
- getData3 += "&GroupType%5B%5D=7"
- if '二字現' in matchend :
- getData3 += "&GroupType%5B%5D=6"
- if '一字現' in matchend :
- getData3 += "&GroupType%5B%5D=5"
- if '四定位' in matchend :
- getData3 += "&GroupType%5B%5D=4"
- if '三定位' in matchend :
- getData3 += "&GroupType%5B%5D=3"
- if '二定位' in matchend :
- getData3 += "&GroupType%5B%5D=2"
- if '一定位' in matchend :
- getData3 += "&GroupType%5B%5D=1"
- getData= "Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- if response3.status_code!=200:
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/FrontA08Report1/MainQuery"#-21=-(/Command/LoginGateway)
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- #print(response3)
- print("AAAAA0")
- if response3.status_code==200:
- jsondata=json.loads(response3.text)
- print("AAAAA1")
- #print(jsondata)
- if response3.text=="null":
- getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA7")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA2")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account=&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- #responsetxt=response3.text
- #print(responsetxt)
- print("AAAAA3")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA4")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA5")
- if response3.text=="null":
- #getData="Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- getData="Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA8")
- jsondata=json.loads(response3.text)
- #print(jsondata)
- print("AAAAA6")
- #====================================種類=========================================
- #====================================解析資料=====================================
- allll3=[]
- if len(jsondata['DataList'])>0:
- #print(len(jsondata['DataList']))
- #print(jsondata['DataList'])
- #print(jsondata['DataList'][0]['NickName'])
- for i in range(len(jsondata['DataList'])):
- allll3.append([])
- allll3[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- allll3[i].append(jsondata['DataList'][i]['TotBet'])
- allll3[i].append(jsondata['DataList'][i]['TotBetRebate'])
- allll3[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- allll3[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- allll3[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- allll3[i].append(None)
- allll3[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- allll3[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- allll3[i].append(jsondata['DataList'][i]['TotPaid'])
- allll3[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- try:
- allll3[i].append(jsondata['DataList'][i]['PaidContributor'])
- except:
- allll3[i].append(None)
- allll3[i].append(jsondata['DataList'][i]['TotContribution'])
- allll3[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- try:
- allll3[i].append(jsondata['DataList'][i]['TotControl'])
- except:
- allll3[i].append(None)
- try:
- allll3[i].append(jsondata['DataList'][i]['TotControlDuty'])
- except:
- allll3[i].append(None)
- try:
- allll3[i].append(jsondata['DataList'][i]['SystemDuty'])
- except:
- allll3[i].append(None)
- print(allll3)
- allll3=pd.DataFrame(allll3)
- allll3.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- allll3=pd.DataFrame()
- fordebugger="查詢期間無資料"
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(allll3)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append("六")
- allll3.insert(0,"開始日期",StartDATETXT)
- allll3.insert(1,"結束日期",EndDATETXT)
- allll3.insert(2,"網址",WEBURLTXT)
- allll3.insert(3,"帳戶",ADMINTXT)
- allll3.insert(4,"隨機碼",TIMERAND)
- print(allll3)
- #=====================================================================================
- refind3=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- allll3=pd.concat([refind3,allll3],ignore_index = True)
- allll=pd.concat([allll,allll3],ignore_index = True)
- if thisfile=="A2.txt":
- getData3 = ""
- if '539' in matchend:
- getData3 += "&GameType%5B%5D=13"
- if '十二不中' in matchend :
- getData3 += "&GroupType%5B%5D=160"
- if '十一不中' in matchend :
- getData3 += "&GroupType%5B%5D=159"
- if '十不中' in matchend :
- getData3 += "&GroupType%5B%5D=158"
- if '九不中' in matchend :
- getData3 += "&GroupType%5B%5D=157"
- if '八不中' in matchend :
- getData3 += "&GroupType%5B%5D=156"
- if '七不中' in matchend :
- getData3 += "&GroupType%5B%5D=155"
- if '六不中' in matchend :
- getData3 += "&GroupType%5B%5D=154"
- if '五不中' in matchend :
- getData3 += "&GroupType%5B%5D=153"
- if '五星' in matchend :
- getData3 += "&GroupType%5B%5D=118"
- if '天碰三' in matchend :
- getData3 += "&GroupType%5B%5D=109"
- if '天碰二' in matchend :
- getData3 += "&GroupType%5B%5D=108"
- if '四星' in matchend :
- getData3 += "&GroupType%5B%5D=107"
- if '三星' in matchend :
- getData3 += "&GroupType%5B%5D=106"
- if '二星' in matchend :
- getData3 += "&GroupType%5B%5D=105"
- if '特尾三' in matchend :
- getData3 += "&GroupType%5B%5D=104"
- if '台號' in matchend :
- getData3 += "&GroupType%5B%5D=103"
- if '特碼' in matchend :
- getData3 += "&GroupType%5B%5D=102"
- if '全車' in matchend :
- getData3 += "&GroupType%5B%5D=101"
- if '合單雙' in matchend:
- getData3 += "&GroupType%5B%5D=9"
- if '四字現' in matchend :
- getData3 += "&GroupType%5B%5D=8"
- if '三字現' in matchend :
- getData3 += "&GroupType%5B%5D=7"
- if '二字現' in matchend :
- getData3 += "&GroupType%5B%5D=6"
- if '一字現' in matchend :
- getData3 += "&GroupType%5B%5D=5"
- if '四定位' in matchend :
- getData3 += "&GroupType%5B%5D=4"
- if '三定位' in matchend :
- getData3 += "&GroupType%5B%5D=3"
- if '二定位' in matchend :
- getData3 += "&GroupType%5B%5D=2"
- if '一定位' in matchend :
- getData3 += "&GroupType%5B%5D=1"
- getData= "Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- if response3.status_code!=200:
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/FrontA08Report1/MainQuery"#-21=-(/Command/LoginGateway)
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- #print(response3)
- print("AAAAA0")
- if response3.status_code==200:
- jsondata=json.loads(response3.text)
- print("AAAAA1")
- #print(jsondata)
- if response3.text=="null":
- getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA7")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA2")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account=&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- #responsetxt=response3.text
- #print(responsetxt)
- print("AAAAA3")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA4")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA5")
- if response3.text=="null":
- #getData="Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- getData="Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA8")
- jsondata=json.loads(response3.text)
- #print(jsondata)
- print("AAAAA6")
- #====================================種類=========================================
- #====================================解析資料=====================================
- allll4=[]
- if len(jsondata['DataList'])>0:
- #print(len(jsondata['DataList']))
- #print(jsondata['DataList'])
- #print(jsondata['DataList'][0]['NickName'])
- for i in range(len(jsondata['DataList'])):
- allll4.append([])
- allll4[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- allll4[i].append(jsondata['DataList'][i]['TotBet'])
- allll4[i].append(jsondata['DataList'][i]['TotBetRebate'])
- allll4[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- allll4[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- allll4[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- allll4[i].append(None)
- allll4[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- allll4[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- allll4[i].append(jsondata['DataList'][i]['TotPaid'])
- allll4[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- try:
- allll4[i].append(jsondata['DataList'][i]['PaidContributor'])
- except:
- allll4[i].append(None)
- allll4[i].append(jsondata['DataList'][i]['TotContribution'])
- allll4[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- try:
- allll4[i].append(jsondata['DataList'][i]['TotControl'])
- except:
- allll4[i].append(None)
- try:
- allll4[i].append(jsondata['DataList'][i]['TotControlDuty'])
- except:
- allll4[i].append(None)
- try:
- allll4[i].append(jsondata['DataList'][i]['SystemDuty'])
- except:
- allll4[i].append(None)
- print(allll4)
- allll4=pd.DataFrame(allll4)
- allll4.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- allll4=pd.DataFrame()
- fordebugger="查詢期間無資料"
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(allll4)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append("五")
- allll4.insert(0,"開始日期",StartDATETXT)
- allll4.insert(1,"結束日期",EndDATETXT)
- allll4.insert(2,"網址",WEBURLTXT)
- allll4.insert(3,"帳戶",ADMINTXT)
- allll4.insert(4,"隨機碼",TIMERAND)
- print(allll4)
- #=====================================================================================
- refind4=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- allll4=pd.concat([refind4,allll4],ignore_index = True)
- allll=pd.concat([allll,allll4],ignore_index = True)
- if thisfile=="A2.txt":
- getData3 = ""
- if '天天樂' in matchend:
- getData3 += "&GameType%5B%5D=22"
- if '十二不中' in matchend :
- getData3 += "&GroupType%5B%5D=160"
- if '十一不中' in matchend :
- getData3 += "&GroupType%5B%5D=159"
- if '十不中' in matchend :
- getData3 += "&GroupType%5B%5D=158"
- if '九不中' in matchend :
- getData3 += "&GroupType%5B%5D=157"
- if '八不中' in matchend :
- getData3 += "&GroupType%5B%5D=156"
- if '七不中' in matchend :
- getData3 += "&GroupType%5B%5D=155"
- if '六不中' in matchend :
- getData3 += "&GroupType%5B%5D=154"
- if '五不中' in matchend :
- getData3 += "&GroupType%5B%5D=153"
- if '五星' in matchend :
- getData3 += "&GroupType%5B%5D=118"
- if '天碰三' in matchend :
- getData3 += "&GroupType%5B%5D=109"
- if '天碰二' in matchend :
- getData3 += "&GroupType%5B%5D=108"
- if '四星' in matchend :
- getData3 += "&GroupType%5B%5D=107"
- if '三星' in matchend :
- getData3 += "&GroupType%5B%5D=106"
- if '二星' in matchend :
- getData3 += "&GroupType%5B%5D=105"
- if '特尾三' in matchend :
- getData3 += "&GroupType%5B%5D=104"
- if '台號' in matchend :
- getData3 += "&GroupType%5B%5D=103"
- if '特碼' in matchend :
- getData3 += "&GroupType%5B%5D=102"
- if '全車' in matchend :
- getData3 += "&GroupType%5B%5D=101"
- if '合單雙' in matchend:
- getData3 += "&GroupType%5B%5D=9"
- if '四字現' in matchend :
- getData3 += "&GroupType%5B%5D=8"
- if '三字現' in matchend :
- getData3 += "&GroupType%5B%5D=7"
- if '二字現' in matchend :
- getData3 += "&GroupType%5B%5D=6"
- if '一字現' in matchend :
- getData3 += "&GroupType%5B%5D=5"
- if '四定位' in matchend :
- getData3 += "&GroupType%5B%5D=4"
- if '三定位' in matchend :
- getData3 += "&GroupType%5B%5D=3"
- if '二定位' in matchend :
- getData3 += "&GroupType%5B%5D=2"
- if '一定位' in matchend :
- getData3 += "&GroupType%5B%5D=1"
- getData= "Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- if response3.status_code!=200:
- GetDataUrl="http:"+SecondLoginUrl[:-21]+"/api/FrontA08Report1/MainQuery"#-21=-(/Command/LoginGateway)
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print(response3)
- print("AAAAA0")
- if response3.status_code==200:
- jsondata=json.loads(response3.text)
- print("AAAAA1")
- #print(jsondata)
- if response3.text=="null":
- getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA7")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate"+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"
- getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA2")
- if response3.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account=&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- #responsetxt=response3.text
- #print(responsetxt)
- print("AAAAA3")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA4")
- if response3.text=="null":
- getData="Account=&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA5")
- if response3.text=="null":
- #getData="Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- getData="Account="+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3 = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=10,verify=False)
- print("AAAAA8")
- jsondata=json.loads(response3.text)
- #print(jsondata)
- print("AAAAA6")
- #====================================種類=========================================
- #====================================解析資料=====================================
- allll5=[]
- if len(jsondata['DataList'])>0:
- #print(len(jsondata['DataList']))
- #print(jsondata['DataList'])
- #print(jsondata['DataList'][0]['NickName'])
- for i in range(len(jsondata['DataList'])):
- allll5.append([])
- allll5[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- allll5[i].append(jsondata['DataList'][i]['TotBet'])
- allll5[i].append(jsondata['DataList'][i]['TotBetRebate'])
- allll5[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- allll5[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- allll5[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- allll5[i].append(None)
- allll5[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- allll5[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- allll5[i].append(jsondata['DataList'][i]['TotPaid'])
- allll5[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- try:
- allll5[i].append(jsondata['DataList'][i]['PaidContributor'])
- except:
- allll5[i].append(None)
- allll5[i].append(jsondata['DataList'][i]['TotContribution'])
- allll5[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- try:
- allll5[i].append(jsondata['DataList'][i]['TotControl'])
- except:
- allll5[i].append(None)
- try:
- allll5[i].append(jsondata['DataList'][i]['TotControlDuty'])
- except:
- allll5[i].append(None)
- try:
- allll5[i].append(jsondata['DataList'][i]['SystemDuty'])
- except:
- allll5[i].append(None)
- print(allll5)
- allll5=pd.DataFrame(allll5)
- allll5.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- allll5=pd.DataFrame()
- fordebugger="查詢期間無資料"
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(allll5)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append("加")
- allll5.insert(0,"開始日期",StartDATETXT)
- allll5.insert(1,"結束日期",EndDATETXT)
- allll5.insert(2,"網址",WEBURLTXT)
- allll5.insert(3,"帳戶",ADMINTXT)
- allll5.insert(4,"隨機碼",TIMERAND)
- print(allll5)
- #=====================================================================================
- refind5=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- allll5=pd.concat([refind5,allll5],ignore_index = True)
- allll=pd.concat([allll,allll5],ignore_index = True)
- """
- #子帳號 #========================================================================================
- doneChild=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- print("childAdminLschildAdminLs:"+str(len(childAdminLs)))
- for i in range(len(childAdminLs)):
- childallll=pd.DataFrame()
- if (urlkey==childAdminLs[i][0] or urlkey==childAdminLs[i][3]) and adminkey== childAdminLs[i][2]:
- childAdmin=childAdminLs[i][1]
- print(childAdmin)
- getData= "Account="+childAdminLs[i][1]+getData3+"&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- #getData= "Account="+childAdminLs[i][1]+"&GameType%5B%5D=35&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- jsondata=json.loads(response3child.text)
- print("chiAAAAA12")
- #print(jsondata)
- if response3child.text=="null":
- getData= "Account="+childAdmin+"&GameType%5B%5D=14&GameType%5B%5D=22&GameType%5B%5D=13&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA13")
- if response3child.text=="null":
- getData= "Account="+childAdmin+"&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA8")
- if response3child.text=="null":
- #getData= "Account=&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- getData= "Account="+childAdmin+"&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#FPK375#jnn688
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA9")
- if response3child.text=="null":
- getData="Account="+childAdmin+"&GameType%5B%5D=22&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=118&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true"#KPC365
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA10")
- if response3child.text=="null":
- getData="Account="+childAdmin+"&GameType%5B%5D=13&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA11")
- if response3child.text=="null":
- getData="Account="+childAdmin+"&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=110&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=102&GroupType%5B%5D=101&StartDate="+startDatekey+"&EndDate="+endDatekey+"&IsNotShowNow=true" #UJK555
- response3child = requests.request("POST", GetDataUrl, headers=headers88, data=getData, timeout=12,verify=False)
- print("chiAAAAA14")
- jsondata=json.loads(response3child.text)
- print(jsondata)
- childallll=[]
- if len(jsondata['DataList'])>0:
- for i in range(len(jsondata['DataList'])):
- childallll.append([])
- childallll[i].append(jsondata['DataList'][i]['NickName']+"("+jsondata['DataList'][i]['Account']+")")
- #
- childallll[i].append(jsondata['DataList'][i]['TotBet'])
- childallll[i].append(jsondata['DataList'][i]['TotBetRebate'])
- childallll[i].append(jsondata['DataList'][i]['TotBetWinLose'])
- childallll[i].append(jsondata['DataList'][i]['SubtotalTotWinLose'])
- if len(jsondata['DataList'][i]['ContributionPaid']) > 7:
- for j in range(7):
- childallll[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- else:
- for j in range(len(jsondata['DataList'][i]['ContributionPaid'])):
- childallll[i].append(jsondata['DataList'][i]['ContributionPaid'][j]['TotPaid'])
- if len(jsondata['DataList'][i]['ContributionPaid'])<7:
- ReAdd=7-len(jsondata['DataList'][i]['ContributionPaid'])
- for z in range(ReAdd):
- childallll[i].append(None)
- childallll[i].append(jsondata['DataList'][i]['SubtotalTotDutyWinLose'])
- childallll[i].append(jsondata['DataList'][i]['SubtotalRebateWinLoseDifference'])
- childallll[i].append(jsondata['DataList'][i]['TotPaid'])
- childallll[i].append(jsondata['DataList'][i]['SubtotalSelfTotWinLose'])
- childallll[i].append(jsondata['DataList'][i]['PaidContributor'])
- childallll[i].append(jsondata['DataList'][i]['TotContribution'])
- childallll[i].append(jsondata['DataList'][i]['SubtotalContribution'])
- childallll[i].append(jsondata['DataList'][i]['TotControl'])
- childallll[i].append(jsondata['DataList'][i]['TotControlDuty'])
- childallll[i].append(jsondata['DataList'][i]['SystemDuty'])
- print(childallll)
-
- childallll=pd.DataFrame(childallll)
- childallll.columns =["名稱","總量","退水","中獎","輸贏","會員","代理","總代理","股東","大股東","總監","大總監","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","調盤退水","調退實佔","系統商"]
- fordebugger="OK"
- else:
- childallll=pd.DataFrame()
- fordebugger="查詢期間無資料"
- print("FA:SSSAEL")
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- nowTime=datetime.datetime.now().strftime("%m%d%H%M%S")
- randomNum=random.randint(0,10000)
- if randomNum<10:
- randomNum=str(0)+str(0)+str(0)+str(randomNum)
- elif randomNum>10 and randomNum<100:
- randomNum=str(0)+str(0)+str(randomNum)
- elif randomNum>100 and randomNum<1000:
- randomNum=str(0)+str(randomNum)
- uniqueNum=str(nowTime)+str(randomNum)
- for i in range(len(childallll)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(childAdmin)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append(None)
-
- childallll.insert(0,"開始日期",StartDATETXT)
- childallll.insert(1,"結束日期",EndDATETXT)
- childallll.insert(2,"網址",WEBURLTXT)
- childallll.insert(3,"帳戶",ADMINTXT)
- childallll.insert(4,"隨機碼",TIMERAND)
- print(childallll)
- #=====================================================================================
- refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","大總監","系統商","隨機碼"])
- #refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監","隨機碼"])
- childallll=pd.concat([refind,childallll],ignore_index = True)
-
- doneChild=pd.concat([refind,doneChild,childallll],ignore_index = True)
- #子帳號========================================================================================
-
- allll=pd.concat([refind,allll,doneChild],ignore_index = True)
- return allll,fordebugger,urlkey,adminkey
- print(getData3.find("GameType"))
- if response3.status_code!=200 and getData3.find("GameType") != -1:
- fordebugger="無法取得資料"
- allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
- elif response3.status_code!=200 and getData3.find("GameType") == -1:
- fordebugger="查詢期間無資料"
- allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
- else:
- fordebugger="查詢期間無資料"
- allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
- if LFLresponse.status_code!=200 :
- allll,fordebugger,urlkey,adminkey=ShortGetData(urlkey, adminkey, passkey, startDatekey, endDatekey,childAdminLs)
- #print(allll)
- return allll,fordebugger,urlkey,adminkey
- except Exception as e:
- fordebugger="無法取得資料"
- print("errorcode4")
- print(e)
- allll=pd.DataFrame()
- return allll,fordebugger,urlkey,adminkey
-
-
- def ShortGetData(urlkey, adminkey, passkey, startDatekey, endDatekey,childAdminLs):
- print("我有進ShortGetData")
- badmatchend= ["單碰","配比包牌","雙面包牌","連碰","柱碰","一比四","套餐","連柱碰","雙星連碰柱","三星連碰柱","雙連碰","全選"]
- try:
- sloginUrl = "https://"+urlkey+"/pub/SuperGateway.php?c=900%2C"+adminkey+"%2C"+passkey
- response = requests.request("POST", sloginUrl, timeout=12,verify=False)
- #jsondata=json.loads(response.text)
- #SIDKey=rrr[2]
- print(response.status_code)
- if response.status_code==200:#如果網站有正常回應
- if len(response.text)>3:#回應的是正確值
- SIDKey=response.text.split(',')[2]#拆分SIDKey
- if len(SIDKey)<5:#如果SIDKey<拆分SIDKey
- SIDKey=response.text.split(',')[3]
- print(SIDKey)
- AMKey=SIDKey.split('_')[0]
- print(AMKey)
- if urlkey == "c56-gdmc.ck9998.net":
- LevelUrl="https://"+urlkey+"/hp/headmenu2.php?si="+SIDKey
- else:
- LevelUrl="https://"+urlkey+"/hp/headmenu.php?si="+SIDKey
- LevelUrlresponse = requests.request("GET", LevelUrl, timeout=12,verify=False)
- print(LevelUrlresponse.status_code)
- print(LevelUrlresponse.text)
- soup=BeautifulSoup(LevelUrlresponse.text,"lxml")
- print(len(LevelUrlresponse.text))
- print("1.RESPONE:"+LevelUrlresponse.text)
- print(soup)
- if len(LevelUrlresponse.text)>1:#一般種類
- #---------------------尋找level-------------------------
- try:
- pattern = re.compile(r'var lv(.*?)=(.*?);',re.MULTILINE|re.DOTALL )
- #print(pattern)
- script = soup.find("script", text=pattern)
- #print(script)
- #print((len(pattern.search(script.string).group())))
- if len(pattern.search(script.string).group())==11:
- Level=pattern.search(script.string).group(2)[1:]
- elif len(pattern.search(script.string).group())==9:
- Level=pattern.search(script.string).group(2)
- #print(pattern.search(script.string).group())
- #print("LEVELLLLL::::::::"+str(Level))
- geeetURL="https://"+urlkey+"/func/report/rpt_plus.php?sid="+SIDKey+"&am="+AMKey+"$l="+Level
- #print(geeetURL)
- editUrlresponse = requests.request("GET", geeetURL, timeout=12,verify=False)
- soup4=BeautifulSoup(editUrlresponse.text,"lxml")
- #print(type(str(soup4)))
- matches = re.finditer(r'/>(.+\w)\s', str(soup4), re.MULTILINE)
- matchend=[]
- for matchNum, match in enumerate(matches, start=1):
- #print ("在{start}-{end}找到匹配{matchNum}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
- for groupNum in range(0, len(match.groups())):
- groupNum = groupNum + 1
- matchtext = match.group(groupNum).strip()
- #print("mat111"+matchtext)
- if matchtext == '加州彩':
- matchtext = '加洲彩'
- #print("mat222"+matchtext)
- if matchtext not in matchend and matchtext not in badmatchend:
- matchend.append(matchtext)
- #print ("在{start}-{end}找到组{groupNum}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
- #print(matchend)
- #print(loopper3)
- #print(len(matchend))
- getData3=Getdata(matchend)
- #print(matchend[1])
- #print(cclist.index(matchend[1]))
- #print(loopper3[0][cclist.index(matchend[1])])
- print("GERDATAAAAA3:"+getData3)
- #print(pattern.search(script.string).group(1))
- #Level=pattern.search(script.string).group(1)
- #---------------------尋找level-------------------------
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- iscommon=1
- except Exception as e:
- print(e)
- #一般商品種類
- else:
- geeetURL="https://"+urlkey+"/func/report/rpt_plus.php?sid="+SIDKey
- print(geeetURL)
- editUrlresponse = requests.request("GET", geeetURL, timeout=12,verify=False)
- soup4=BeautifulSoup(editUrlresponse.text,"lxml")
- #print(soup4)
- matches = re.finditer(r'/>(.+\w)\s', str(soup4), re.MULTILINE)
- matchend=[]
- for matchNum, match in enumerate(matches, start=1):
- #print ("在{start}-{end}找到匹配{matchNum}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
- for groupNum in range(0, len(match.groups())):
- groupNum = groupNum + 1
- matchtext = match.group(groupNum).strip()
- #print("mat11"+matchtext)
- if matchtext == "加州彩":
- matchtext = "加洲彩"
- #print("mat22"+matchtext)
- if matchtext not in matchend and matchtext not in badmatchend:
- matchend.append(matchtext)
- #print ("在{start}-{end}找到组{groupNum}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
- print(matchend)
- print(loopper3)
- print(len(matchend))
- getData3=Getdata(matchend)
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- print(payload)
- iscommon=0
- #後台用商品種類
- GetUrl="https://"+urlkey+"/func/report/rpt_allplus.php"
- GetHeaders = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
-
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=12,verify=False)
- #print(GetResponse.status_code)
- #print(GetResponse.text)
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" or GetResponse.text == "您所搜尋的日期範圍並無任何期數喔":
- val=pd.DataFrame()
- fordebugger="查詢期間無資料"
- else:
- #向網站取得資料
- val=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
- print(len(val))
- if len(val)>0:#是否有資料
- val.columns = val.loc[0].values.tolist()
- val=val.drop([0])
- print(val)
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(val)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- if thisfile=="A2.txt":
- TIMERAND.append("全")
- else:
- TIMERAND.append(None)
- val.insert(0,"開始日期",StartDATETXT)
- val.insert(1,"結束日期",EndDATETXT)
- val.insert(2,"網址",WEBURLTXT)
- val.insert(3,"帳戶",ADMINTXT)
- val.insert(4,"隨機碼",TIMERAND)
- #======================================================
- # refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","隨機碼"])
- refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- #重整資料用
- val=pd.concat([refind,val],ignore_index = True)
- #=========================================================
- if len(val)>0:#如果有資料
- val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- # val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"]
- fordebugger="OK"
- else:
- val=pd.DataFrame()
- fordebugger="查詢期間無資料"
- """
- if thisfile == "A2.txt":
- if matchend[12] == '六合' or matchend[12] =='大樂' or matchend[12] =='539'or matchend[12] =='加洲彩':
- getData3 = "&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas1=yes"
- if iscommon==1:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- elif iscommon==0:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- print(payload)
- GetUrl="https://"+urlkey+"/func/report/rpt_allplus.php"
- GetHeaders = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=10,verify=False)
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" or GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" :
- val2=pd.DataFrame()
- print("2無資料")
- fordebugger="ok"
- else:
- val2=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
- if len(val2)>0:#是否有資料
- val2.columns = val2.loc[0].values.tolist()
- val2=val2.drop([0])
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(val2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- if matchend[12] == '六合':
- TIMERAND.append("六")
- elif matchend[12] == '539':
- TIMERAND.append("五")
- elif matchend[12] == '大樂':
- TIMERAND.append("大")
- elif matchend[12] == '加洲彩':
- TIMERAND.append("加")
- val2.insert(0,"開始日期",StartDATETXT)
- val2.insert(1,"結束日期",EndDATETXT)
- val2.insert(2,"網址",WEBURLTXT)
- val2.insert(3,"帳戶",ADMINTXT)
- val2.insert(4,"隨機碼",TIMERAND)
- #======================================================
- # refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","隨機碼"])
- refind2=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- val2 =pd.concat([refind2,val2],ignore_index = True)
- if len(val2)>0:#如果有資料
- val2.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- # val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"]
- fordebugger="OK"
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- val = pd.concat([val,val2],ignore_index = True)
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- if thisfile == "A2.txt":
- if matchend[13] == '六合' or matchend[13] =='大樂' or matchend[13] =='539' or matchend[13] =='加洲彩':
- getData3 = "&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas2=yes"
- if iscommon==1:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- elif iscommon==0:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- GetUrl="https://"+urlkey+"/func/report/rpt_allplus.php"
- GetHeaders = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=10,verify=False)
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" or GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" :
- val3=pd.DataFrame()
- print("3無資料")
- fordebugger="ok"
- else:
- val3=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
- if len(val3)>0:#是否有資料
- val3.columns = val3.loc[0].values.tolist()
- val3=val3.drop([0])
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(val3)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- if matchend[13] == '六合':
- TIMERAND.append("六")
- elif matchend[13] == '539':
- TIMERAND.append("五")
- elif matchend[13] == '大樂':
- TIMERAND.append("大")
- elif matchend[13] == '加洲彩':
- TIMERAND.append("加")
- val3.insert(0,"開始日期",StartDATETXT)
- val3.insert(1,"結束日期",EndDATETXT)
- val3.insert(2,"網址",WEBURLTXT)
- val3.insert(3,"帳戶",ADMINTXT)
- val3.insert(4,"隨機碼",TIMERAND)
- #======================================================
- # refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","隨機碼"])
- refind3=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- val3 =pd.concat([refind3,val3],ignore_index = True)
- if len(val3)>0:#如果有資料
- val3.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- # val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"]
- fordebugger="OK"
- else:
- val3=pd.DataFrame()
- fordebugger="OK"
- val = pd.concat([val,val3],ignore_index = True)
- else:
- val3=pd.DataFrame()
- fordebugger="OK"
- if thisfile == "A2.txt":
- if matchend[14] == '六合' or matchend[14] =='大樂' or matchend[14] =='539' or matchend[14] =='加洲彩':
- getData3 = "&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas3=yes"
- if iscommon==1:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- elif iscommon==0:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- GetUrl="https://"+urlkey+"/func/report/rpt_allplus.php"
- GetHeaders = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=10,verify=False)
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" or GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" :
- val4=pd.DataFrame()
- print("4無資料")
- fordebugger="ok"
- else:
- val4=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
- if len(val4)>0:#是否有資料
- val4.columns = val4.loc[0].values.tolist()
- val4=val4.drop([0])
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(val4)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- if matchend[14] == '六合':
- TIMERAND.append("六")
- elif matchend[14] == '539':
- TIMERAND.append("五")
- elif matchend[14] == '大樂':
- TIMERAND.append("大")
- elif matchend[15] == '加洲彩':
- TIMERAND.append("加")
- val4.insert(0,"開始日期",StartDATETXT)
- val4.insert(1,"結束日期",EndDATETXT)
- val4.insert(2,"網址",WEBURLTXT)
- val4.insert(3,"帳戶",ADMINTXT)
- val4.insert(4,"隨機碼",TIMERAND)
- #======================================================
- # refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","隨機碼"])
- refind4=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- val4 =pd.concat([refind4,val4],ignore_index = True)
- if len(val4)>0:#如果有資料
- val4.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- # val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"]
- fordebugger="OK"
- else:
- val4=pd.DataFrame()
- fordebugger="OK"
- val = pd.concat([val,val4],ignore_index = True)
- else:
- val4=pd.DataFrame()
- fordebugger="OK"
- if thisfile == "A2.txt" and len(matchend) ==16:
- if matchend[15] == '六合' or matchend[15] =='大樂' or matchend[15] =='539' or matchend[15] =='加洲彩':
- getData3 = "&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas4=yes"
- if iscommon==1:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- elif iscommon==0:
- payload='sacco=&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- GetUrl="https://"+urlkey+"/func/report/rpt_allplus.php"
- GetHeaders = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=10,verify=False)
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" or GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" :
- val5=pd.DataFrame()
- print("5無資料")
- fordebugger="ok"
- else:
- val5=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
- if len(val5)>0:#是否有資料
- val5.columns = val5.loc[0].values.tolist()
- val5=val5.drop([0])
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- for i in range(len(val5)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- if matchend[15] == '六合':
- TIMERAND.append("六")
- elif matchend[15] == '539':
- TIMERAND.append("五")
- elif matchend[15] == '大樂':
- TIMERAND.append("大")
- elif matchend[15] == '加洲彩':
- TIMERAND.append("加")
- val5.insert(0,"開始日期",StartDATETXT)
- val5.insert(1,"結束日期",EndDATETXT)
- val5.insert(2,"網址",WEBURLTXT)
- val5.insert(3,"帳戶",ADMINTXT)
- val5.insert(4,"隨機碼",TIMERAND)
- #======================================================
- # refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","隨機碼"])
- refind5=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- val5 =pd.concat([refind5,val5],ignore_index = True)
- if len(val5)>0:#如果有資料
- val5.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- # val.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"]
- fordebugger="OK"
- else:
- val5=pd.DataFrame()
- fordebugger="OK"
- val = pd.concat([val,val5],ignore_index = True)
- else:
- val5=pd.DataFrame()
- fordebugger="OK"
- """
- #========================================================
- #=================子帳號=======================================
- doneChildval=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"])
- for i in range(len(childAdminLs)):
- childval=pd.DataFrame()
- if (urlkey==childAdminLs[i][0]or urlkey==childAdminLs[i][3])and adminkey== childAdminLs[i][2]:
- childAdmin=childAdminLs[i][1]
- if iscommon==1:
- payload='sacco='+childAdmin+'&data1='+startDatekey+'&data2='+endDatekey+getData3+'&am='+AMKey+'&l='+Level+'&sid='+SIDKey+'&master=%20&Submit=%25E7%25A2%25BA%25E5%25AE%259A'
- elif iscommon==0:
- payload='sacco='+childAdmin+'&data1='+startDatekey+'&data2='+endDatekey+getData3+'&l=&sid='+SIDKey+'&master=yes&am='
- GetResponse = requests.request("POST", GetUrl, headers=GetHeaders, data=payload, timeout=12,verify=False)
- childval=pd.DataFrame(pd.read_html(GetResponse.text)[2])[:-1]
-
- if len(childval)>0:#是否有資料
- childval.columns = childval.loc[0].values.tolist()
- childval=childval.drop([0])
- #print(childval)
- #================將資訊插入資料=================================
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- TIMERAND=[]
- nowTime=datetime.datetime.now().strftime("%m%d%H%M%S")
- randomNum=random.randint(0,10000);
- if randomNum<10:
- randomNum=str(0)+str(0)+str(0)+str(randomNum)
- elif randomNum>10 and randomNum<100:
- randomNum=str(0)+str(0)+str(randomNum)
- elif randomNum>100 and randomNum<1000:
- randomNum=str(0)+str(randomNum)
- uniqueNum=str(nowTime)+str(randomNum)
- for i in range(len(childval)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(childAdmin)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- TIMERAND.append(None)
- childval.insert(0,"開始日期",StartDATETXT)
- childval.insert(1,"結束日期",EndDATETXT)
- childval.insert(2,"網址",WEBURLTXT)
- childval.insert(3,"帳戶",ADMINTXT)
- childval.insert(4,"隨機碼",TIMERAND)
- refind=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶","總量","中獎","輸贏","客戶小計","代理小計","總代理小計","股東小計","大股東小計","總監小計","個人所得","水差","下注明細","查看對帳","貢獻額","貢獻度","調盤退水","調退實佔","隨機碼"])
- #重整資料用
- childval=pd.concat([refind,childval],ignore_index = True)
- if len(childval)>0:#如果有資料
- childval.columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","隨機碼"]
- fordebugger="OK"
- else:
- childval=pd.DataFrame()
- fordebugger="查詢期間無資料"
- if GetResponse.text == "您所搜尋的日期範圍並無任何期數喔" :
- childval=pd.DataFrame()
- fordebugger="查詢期間無資料"
- doneChildval=pd.concat([doneChildval,childval],ignore_index = True)
- #========================================================
- val=pd.concat([val,doneChildval],ignore_index = True)
- return val,fordebugger,urlkey,adminkey
- else:
- val=pd.DataFrame()
- print("error 1")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
-
- if response.status_code!=200:
- val=pd.DataFrame()
- print("error 2")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
- except:
- val=pd.DataFrame()
- print("error 3")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
-
- def Getdata(matchend):
- cclist=["四星彩","三星彩","六合","大樂","539","威力","天天樂","全車","特碼","台號","特尾三","二星","三星","四星","天碰二","天碰三","五星","五不中","六不中","七不中","八不中","九不中",
- "十不中","十一不中","十二不中","一定位","二定位","三定位","四定位","一字現","二字現","三字現","四字現","合單雙","加洲彩","雙面","反轉樂","迦納彩"]
- getData3=""
- if len(matchend) == 15 :
- if matchend[0] in cclist and loopper3[0][cclist.index(matchend[0])] == True:
- getData3 += "&check0=yes"
- if matchend[1] in cclist and loopper3[0][cclist.index(matchend[1])] == True:
- getData3 += "&check1=yes"
- if matchend[2] in cclist and loopper3[0][cclist.index(matchend[2])] == True:
- getData3 += "&check2=yes"
- if matchend[3] in cclist and loopper3[0][cclist.index(matchend[3])] == True:
- getData3 += "&check3=yes"
- if matchend[4] in cclist and loopper3[0][cclist.index(matchend[4])] == True:
- getData3 += "&check4=yes"
- if matchend[5] in cclist and loopper3[0][cclist.index(matchend[5])] == True:
- getData3 += "&check5=yes"
- if matchend[6] in cclist and loopper3[0][cclist.index(matchend[6])] == True:
- getData3 += "&check6=yes"
- if matchend[7] in cclist and loopper3[0][cclist.index(matchend[7])] == True:
- getData3 += "&check7=yes"
- if matchend[8] in cclist and loopper3[0][cclist.index(matchend[8])] == True:
- getData3 += "&check8=yes"
- if matchend[9] in cclist and loopper3[0][cclist.index(matchend[9])] == True:
- getData3 += "&check9=yes"
- if matchend[10] in cclist and loopper3[0][cclist.index(matchend[10])] == True:
- getData3 += "&check10=yes"
- if matchend[11] in cclist and loopper3[0][cclist.index(matchend[11])] == True:
- getData3 += "&check11=yes"
- if matchend[12] in cclist and loopper3[0][cclist.index(matchend[12])] == True:
- getData3 += "&cas1=yes"
- if matchend[13] in cclist and loopper3[0][cclist.index(matchend[13])] == True:
- getData3 += "&cas2=yes"
- if matchend[14] in cclist and loopper3[0][cclist.index(matchend[14])] == True:
- getData3 += "&cas3=yes"
- elif len(matchend) == 16:
- print(matchend[0])
- print(loopper3[0][cclist.index(matchend[0])])
- if matchend[0] in cclist and loopper3[0][cclist.index(matchend[0])] == True:
- getData3 += "&check0=yes"
- if matchend[1] in cclist and loopper3[0][cclist.index(matchend[1])] == True:
- getData3 += "&check1=yes"
- if matchend[2] in cclist and loopper3[0][cclist.index(matchend[2])] == True:
- getData3 += "&check2=yes"
- if matchend[3] in cclist and loopper3[0][cclist.index(matchend[3])] == True:
- getData3 += "&check3=yes"
- if matchend[4] in cclist and loopper3[0][cclist.index(matchend[4])] == True:
- getData3 += "&check4=yes"
- if matchend[5] in cclist and loopper3[0][cclist.index(matchend[5])] == True:
- getData3 += "&check5=yes"
- if matchend[6] in cclist and loopper3[0][cclist.index(matchend[6])] == True:
- getData3 += "&check6=yes"
- if matchend[7] in cclist and loopper3[0][cclist.index(matchend[7])] == True:
- getData3 += "&check7=yes"
- if matchend[8] in cclist and loopper3[0][cclist.index(matchend[8])] == True:
- getData3 += "&check8=yes"
- if matchend[9] in cclist and loopper3[0][cclist.index(matchend[9])] == True:
- getData3 += "&check9=yes"
- if matchend[10] in cclist and loopper3[0][cclist.index(matchend[10])] == True:
- getData3 += "&check10=yes"
- if matchend[11] in cclist and loopper3[0][cclist.index(matchend[11])] == True:
- getData3 += "&check11=yes"
- if matchend[12] in cclist and loopper3[0][cclist.index(matchend[12])] == True:
- getData3 += "&cas1=yes"
- if matchend[13] in cclist and loopper3[0][cclist.index(matchend[13])] == True:
- getData3 += "&cas2=yes"
- if matchend[14] in cclist and loopper3[0][cclist.index(matchend[14])] == True:
- getData3 += "&cas3=yes"
- print(matchend[15])
- print(cclist.index(matchend[15]))
- if matchend[15] in cclist and loopper3[0][cclist.index(matchend[15])] == True:
- getData3 += "&cas4=yes"
- print(getData3)
- return getData3
-
- def OutbetGetData(urlkey,adminkey,passkey, startDatekey, endDatekey):
- print("OutbetGetData")
- badmatchend= ["單碰","配比包牌","雙面包牌","連碰","柱碰","一比四","套餐","連柱碰","雙星連碰柱","三星連碰柱","雙連碰","全選"]
- try:
- sloginUrl = "https://"+urlkey+"/pub/SuperGateway.php?c=900%2C"+adminkey+"%2C"+passkey
- response = requests.request("POST", sloginUrl, timeout=12,verify=False)
- #jsondata=json.loads(response.text)
- #SIDKey=rrr[2]
- #print(response.status_code)
- if response.status_code==200:#如果網站有正常回應
- if len(response.text)>3:#回應的是正確值
- SIDKey=response.text.split(',')[2]#拆分SIDKey
- if len(SIDKey)<5:#如果SIDKey<拆分SIDKey
- SIDKey=response.text.split(',')[3]
- print(SIDKey)
- AMKey=SIDKey.split('_')[0]
- print(AMKey)
- LevelUrl="https://"+urlkey+"/hp/headmenu.php?si="+SIDKey
- LevelUrlresponse = requests.request("GET", LevelUrl, timeout=12,verify=False)
- #print(LevelUrlresponse.status_code)
- #print(LevelUrlresponse.text)
- soup=BeautifulSoup(LevelUrlresponse.text,"lxml")
- #print(len(LevelUrlresponse.text))
- #print("RESPONE:"+LevelUrlresponse.text)
- #print(soup)
- if len(LevelUrlresponse.text)>1:#一般種類
- #---------------------尋找level-------------------------
- try:
-
- pattern = re.compile(r'var lv(.*?)=(.*?);',re.MULTILINE|re.DOTALL )
- #print(pattern)
- script = soup.find("script", text=pattern)
- #print(script)
- #print((len(pattern.search(script.string).group())))
- if len(pattern.search(script.string).group())==11:
- Level=pattern.search(script.string).group(2)[1:]
- elif len(pattern.search(script.string).group())==9:
- Level=pattern.search(script.string).group(2)
- #print(pattern.search(script.string).group())
- #print("LEVELLLLL::::::::"+str(Level))
- geeetURL="https://"+urlkey+"/func/report/rpt_plus.php?sid="+SIDKey+"&am="+AMKey+"$l="+Level
- print(geeetURL)
- editUrlresponse = requests.request("GET", geeetURL, timeout=12,verify=False)
- soup4=BeautifulSoup(editUrlresponse.text,"lxml")
- #print(type(str(soup4)))
- matches = re.finditer(r'/>(.+\w)\s', str(soup4), re.MULTILINE)
- matchend=[]
- for matchNum, match in enumerate(matches, start=1):
- #print ("在{start}-{end}找到匹配{matchNum}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
- for groupNum in range(0, len(match.groups())):
- groupNum = groupNum + 1
- matchtext = match.group(groupNum).strip()
- if matchtext == '加州彩':
- matchtext = '加洲彩'
- if matchtext not in matchend and matchtext not in badmatchend:
- matchend.append(matchtext)
- #print ("在{start}-{end}找到组{groupNum}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
- #---------------------尋找level-------------------------
- iscommon=1
- except Exception as e:
- print(e)
- else:
- geeetURL="https://"+urlkey+"/func/report/rpt_plus.php?sid="+SIDKey
- editUrlresponse = requests.request("GET", geeetURL, timeout=12,verify=False)
- soup4=BeautifulSoup(editUrlresponse.text,"lxml")
- matches = re.finditer(r'/>(.+\w)\s', str(soup4), re.MULTILINE)
- matchend=[]
- for matchNum, match in enumerate(matches, start=1):
- #print ("在{start}-{end}找到匹配{matchNum}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
- for groupNum in range(0, len(match.groups())):
- groupNum = groupNum + 1
- matchtext = match.group(groupNum).strip()
- if matchtext == "加州彩":
- matchtext = "加洲彩"
- if matchtext not in matchend and matchtext not in badmatchend:
- matchend.append(matchtext)
- #print ("在{start}-{end}找到组{groupNum}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
- iscommon=0
- print(matchend)
- print(len(matchend))
- #==================外埔==================================
- if len(matchend) == 16 :
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas1=yes&cas2=yes&cas3=yes&cas4=yes'
- else:
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas1=yes&cas2=yes&cas3=yes'
- GetUrlo="https://"+urlkey+"/func/supply/page/report/outbet_all.php"
- GetHeaderso = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponseo = requests.request("POST", GetUrlo, headers=GetHeaderso, data=payloado, timeout=12,verify=False)
- if len(GetResponseo.text)>5:
- print("有外埔")
- try:
- val=pd.DataFrame(pd.read_html(GetResponseo.text)[0])[:-2]
- val = val.drop(val.columns[0:3],axis=1)
- print(len(val))
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- for i in range(len(val)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- val.insert(0,"開始日期",StartDATETXT)
- val.insert(1,"結束日期",EndDATETXT)
- val.insert(2,"網址",WEBURLTXT)
- val.insert(3,"帳戶",ADMINTXT)
- val.insert(4,"狀態","全")
- val.columns =["開始日期","結束日期","網址","帳戶","狀態","總量","退水","中獎","小計"]
- print(val)
- fordebugger="OK"
- except Exception as e:
- print(e)
- if matchend[12] == '六合' or matchend[12] == '大樂' or matchend[12] == '539' or matchend[12] == '加洲彩':
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas1=yes'
- GetUrlo="https://"+urlkey+"/func/supply/page/report/outbet_all.php"
- GetHeaderso = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponseo = requests.request("POST", GetUrlo, headers=GetHeaderso, data=payloado, timeout=12,verify=False)
- if len(GetResponseo.text)>5:
- print("有外埔2")
- try:
- val2=pd.DataFrame(pd.read_html(GetResponseo.text)[0])[:-2]
- val2 = val2.drop(val2.columns[0:3],axis=1)
- print(len(val2))
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- for i in range(len(val2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- val2.insert(0,"開始日期",StartDATETXT)
- val2.insert(1,"結束日期",EndDATETXT)
- val2.insert(2,"網址",WEBURLTXT)
- val2.insert(3,"帳戶",ADMINTXT)
- if matchend[12] == '六合':
- val2.insert(4,"狀態","六")
- elif matchend[12] == '539':
- val2.insert(4,"狀態","五")
- elif matchend[12] == '大樂':
- val2.insert(4,"狀態","大")
- elif matchend[12] == '加洲彩':
- val2.insert(4,"狀態","加")
- else:
- val2.insert(4,"狀態","E")
- val2.columns =["開始日期","結束日期","網址","帳戶","狀態","總量","退水","中獎","小計"]
- print(val2)
- val=pd.concat([val,val2],ignore_index = True)
- fordebugger="OK"
- print(val)
- except Exception as e:
- print(e)
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔2")
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔2")
- if matchend[13] == '六合' or matchend[13] =='大樂' or matchend[13] =='539' or matchend[13] =='加洲彩':
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas2=yes'
- GetUrlo="https://"+urlkey+"/func/supply/page/report/outbet_all.php"
- GetHeaderso = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponseo = requests.request("POST", GetUrlo, headers=GetHeaderso, data=payloado, timeout=12,verify=False)
- if len(GetResponseo.text)>5:
- print("有外埔3")
- try:
- val2=pd.DataFrame(pd.read_html(GetResponseo.text)[0])[:-2]
- val2 = val2.drop(val2.columns[0:3],axis=1)
- print(len(val2))
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- for i in range(len(val2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- val2.insert(0,"開始日期",StartDATETXT)
- val2.insert(1,"結束日期",EndDATETXT)
- val2.insert(2,"網址",WEBURLTXT)
- val2.insert(3,"帳戶",ADMINTXT)
- if matchend[13] == '六合':
- val2.insert(4,"狀態","六")
- elif matchend[13] == '539':
- val2.insert(4,"狀態","五")
- elif matchend[13] == '大樂':
- val2.insert(4,"狀態","大")
- elif matchend[13] == '加洲彩':
- val2.insert(4,"狀態","加")
- else:
- val2.insert(4,"狀態","E")
- val2.columns =["開始日期","結束日期","網址","帳戶","狀態","總量","退水","中獎","小計"]
- print(val2)
- val=pd.concat([val,val2],ignore_index = True)
- fordebugger="OK"
- print(val)
- except Exception as e:
- print(e)
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔3")
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔3")
- if matchend[14] == '六合' or matchend[14] =='大樂' or matchend[14] =='539' or matchend[14] =='加洲彩':
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas3=yes'
- GetUrlo="https://"+urlkey+"/func/supply/page/report/outbet_all.php"
- GetHeaderso = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponseo = requests.request("POST", GetUrlo, headers=GetHeaderso, data=payloado, timeout=12,verify=False)
- if len(GetResponseo.text)>5:
- print("有外埔4")
- try:
- val2=pd.DataFrame(pd.read_html(GetResponseo.text)[0])[:-2]
- val2 = val2.drop(val2.columns[0:3],axis=1)
- print(len(val2))
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- for i in range(len(val2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- val2.insert(0,"開始日期",StartDATETXT)
- val2.insert(1,"結束日期",EndDATETXT)
- val2.insert(2,"網址",WEBURLTXT)
- val2.insert(3,"帳戶",ADMINTXT)
- if matchend[14] == '六合':
- val2.insert(4,"狀態","六")
- elif matchend[14] == '539':
- val2.insert(4,"狀態","五")
- elif matchend[14] == '大樂':
- val2.insert(4,"狀態","大")
- elif matchend[14] == '加洲彩':
- val2.insert(4,"狀態","加")
- else:
- val2.insert(4,"狀態","E")
- val2.columns =["開始日期","結束日期","網址","帳戶","狀態","總量","退水","中獎","小計"]
- print(val2)
- val=pd.concat([val,val2],ignore_index = True)
- fordebugger="OK"
- print(val)
- except Exception as e:
- print(e)
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔4")
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔4")
- if len(matchend) ==16 :
- if matchend[15] == '六合' or matchend[15] =='大樂' or matchend[15] =='539' or matchend[15] =='加洲彩':
- payloado='data1='+startDatekey+'&data2='+endDatekey+'&checka=yes&check0=yes&check1=yes&check2=yes&check3=yes&check4=yes&check5=yes&check6=yes&check7=yes&check8=yes&check9=yes&check10=yes&check11=yes&cas4=yes'
- GetUrlo="https://"+urlkey+"/func/supply/page/report/outbet_all.php"
- GetHeaderso = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- }
- GetResponseo = requests.request("POST", GetUrlo, headers=GetHeaderso, data=payloado, timeout=12,verify=False)
- if len(GetResponseo.text)>5:
- print("有外埔5")
- try:
- val2=pd.DataFrame(pd.read_html(GetResponseo.text)[0])[:-2]
- val2 = val2.drop(val2.columns[0:3],axis=1)
- print(len(val2))
- WEBURLTXT=[]
- ADMINTXT=[]
- StartDATETXT=[]
- EndDATETXT=[]
- for i in range(len(val2)):
- WEBURLTXT.append(urlkey)
- ADMINTXT.append(adminkey)
- StartDATETXT.append(startDatekey)
- EndDATETXT.append(endDatekey)
- val2.insert(0,"開始日期",StartDATETXT)
- val2.insert(1,"結束日期",EndDATETXT)
- val2.insert(2,"網址",WEBURLTXT)
- val2.insert(3,"帳戶",ADMINTXT)
- if matchend[15] == '六合':
- val2.insert(4,"狀態","六")
- elif matchend[15] == '539':
- val2.insert(4,"狀態","五")
- elif matchend[15] == '大樂':
- val2.insert(4,"狀態","大")
- elif matchend[15] == '加洲彩':
- val2.insert(4,"狀態","加")
- else:
- val2.insert(4,"狀態","E")
- val2.columns =["開始日期","結束日期","網址","帳戶","狀態","總量","退水","中獎","小計"]
- print(val2)
- val=pd.concat([val,val2],ignore_index = True)
- fordebugger="OK"
- print(val)
- except Exception as e:
- print(e)
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔5")
- else:
- val2=pd.DataFrame()
- fordebugger="OK"
- print("無外埔5")
- else:
- val=pd.DataFrame()
- fordebugger="OK"
- print("無外埔")
- return val,fordebugger,urlkey,adminkey
- else:
- val=pd.DataFrame()
- print("error 1")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
-
- if response.status_code!=200:
- val=pd.DataFrame()
- print("error 2")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
- except:
- val=pd.DataFrame()
- print("error 3")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
-
- def BallGetData(urlkey,adminkey,passkey, startDatekey, endDatekey):
- print("BallGetData")
- val=pd.DataFrame()
- print("error 3")
- fordebugger="無法取得資料"
- return val,fordebugger,urlkey,adminkey
-
-
- class External(QThread):
- """
- Runs a counter thread.
- """
-
- countChanged = pyqtSignal(int)#介面用進度條
- urlChanged=pyqtSignal(str)#介面用網址資訊
- def run(self):
- try:
- ALLDataFrameList=[]
- DebugCodeList=[]
- ALLDataFrameList.append(refindlong)
- ALLDataFrameList.append(refindshort)
- ALLDataFrameList=pd.concat(ALLDataFrameList)
- #-----------------------------------------------------------------------------------------------
- #多執行續
- with ThreadPoolExecutor(max_workers=10) as executor:
- futures = []
- test=[]
- z=0
- x=len(UrlList)
- y=len(AdminList)
- for urlkey,adminkey,passkey,backupUrl in zip(UrlList,AdminList,PasswordList,backupUrlList):
- future=executor.submit(LongGetData,urlkey,adminkey,passkey, startDatekey, endDatekey,backupUrl,childAdminLs)
- futures.append(future)#已完成的
- for future in as_completed(futures):
- test.append(list(future.result()))
- MDF,MDC,MURL,ADMINNNNNN=list(future.result())
- #MDF=pd.concat([ALLDataFrameList,MDF])
- #MDF.to_sql('流水帳', con=engine3, if_exists='append')
- if MURL in UrlList :
- f1=UrlList.index(MURL)
- if ADMINNNNNN in AdminList:
- f2=AdminList.index(ADMINNNNNN,f1)
- try:
- MURL2=str(UrlList[f2+1])
- except:
- MURL2="最後一個"
- elif MURL in backupUrlList:
- f1=backupUrlList.index(MURL)
- if ADMINNNNNN in AdminList:
- f2=AdminList.index(ADMINNNNNN,f1)
- try:
- MURL2=str(UrlList[f2+1])
- except:
- MURL2="最後一個"
- MDCURL=MURL+"=>"+MDC+"\n等待中=>"+MURL2
- percentvalues=((z+1)/x)*100
- self.countChanged.emit(percentvalues)
- self.urlChanged.emit(MDCURL)
- z=z+1
- #-----------------------------------------------------------------------------------------------
-
- ALLDataFrameList0,DebugCodeList,UrlDebugList,ADMINKEYLIST=zip(*test)
- ALLDataFrameList0=pd.concat(ALLDataFrameList0)
-
- neewDataFrmoe=pd.concat([ALLDataFrameList,ALLDataFrameList0])
-
- print(neewDataFrmoe)
-
-
- #-------------------------------------------------------------------------
- #=============================LOGER======================================
- LOGGER=[]
- y=0
- for UrlDebugListlog,DebugCodeListlog,ADMINKEYLISTlog in zip(UrlDebugList,DebugCodeList,ADMINKEYLIST):
- if DebugCodeListlog=="OK":
- print("OK")
- else:
- LOGGER.append([])
- randomNum=random.randint(0,9)
- nowTime=datetime.datetime.now().strftime("%Y-%m-%d-%H:%M:%S")
- nowTime=str(nowTime)+"---"+str(randomNum)
- LOGGER[y].append(coustomtxt)
- LOGGER[y].append(startDatekey+"-"+endDatekey)
- LOGGER[y].append(UrlDebugListlog)
- LOGGER[y].append(DebugCodeListlog)
- LOGGER[y].append(nowTime)
- LOGGER[y].append(ADMINKEYLISTlog)
- y=y+1
-
- LOGGER=pd.DataFrame(LOGGER)
- if len(LOGGER)>0:
- LOGGER.columns =["客戶","查詢區間","網址","狀態","查詢時間","帳號"]
- else:
- print("NO LOG")
- print(LOGGER)
- #===================================================================================
- end = time.time()
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理中...")
- #------------------------------------------------------------------------
- #neewDataFrmoe.to_csv("M126UI.csv",encoding="utf_8_sig")#for debug
- print("FILE明子...asdasdasd:"+thisfile)
- if thisfile=="A1.txt":
- neewDataFrmoe.to_sql('流水帳', con=engine3, if_exists='append')
- elif thisfile=="A2.txt" :
- neewDataFrmoe.to_sql('後台流水帳', con=engine3, if_exists='append')
- LOGGER.to_sql('LOG', con=engine3, if_exists='append')
-
-
- if thisfile=="A1.txt":
- closedatalodibg=LoadingYesorNo()
- end = time.time()
- print("執行時間:%f 秒" % (end - start))
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理完成")
- print("DONE.....................100%")
- #window.close()
- app.quit()
-
- except Exception:
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
-
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('連線資料錯誤')
- app1.exec_()
- finally:
- if thisfile=="A1.txt":
- closedatalodibg=LoadingYesorNo()
-
- class External2(QThread):
- """
- Runs a counter thread.
- """
- countChanged = pyqtSignal(int)#介面用進度條
- urlChanged=pyqtSignal(str)#介面用網址資訊
- def run(self):
- try:
- ALLDataFrameList=[]
- DebugCodeList=[]
- ALLDataFrameList.append(refindoutbet)
- ALLDataFrameList=pd.concat(ALLDataFrameList)
- #-----------------------------------------------------------------------------------------------
- #多執行續
- with ThreadPoolExecutor(max_workers=10) as executor:
- futures = []
- test=[]
- z=0
- x=len(UrlList)
- for urlkey,adminkey,passkey,backupUrl in zip(UrlList,AdminList,PasswordList,backupUrlList):
- future=executor.submit(OutbetGetData,urlkey,adminkey,passkey, startDatekey, endDatekey)
- futures.append(future)#已完成的
- for future in as_completed(futures):
- test.append(list(future.result()))
- MDF,MDC,MURL,ADMINNNNNN=list(future.result())
- #MDF=pd.concat([ALLDataFrameList,MDF])
- #MDF.to_sql('流水帳', con=engine3, if_exists='append')
- MDCURL=MURL+"=>"+MDC
- percentvalues=((z+1)/x)*100
- self.countChanged.emit(percentvalues)
- self.urlChanged.emit(MDCURL)
- z=z+1
- #-----------------------------------------------------------------------------------------------
-
- ALLDataFrameList0,DebugCodeList,UrlDebugList,ADMINKEYLIST=zip(*test)
- ALLDataFrameList0=pd.concat(ALLDataFrameList0)
- neewDataFrmoe=pd.concat([ALLDataFrameList,ALLDataFrameList0])
-
- print("newwwwww"+str(neewDataFrmoe))
-
-
- #-------------------------------------------------------------------------
- #=============================LOGER======================================
- LOGGER=[]
- y=0
- for UrlDebugListlog,DebugCodeListlog,ADMINKEYLISTlog in zip(UrlDebugList,DebugCodeList,ADMINKEYLIST):
- if DebugCodeListlog=="OK":
- print("OK")
- else:
- LOGGER.append([])
- randomNum=random.randint(0,9)
- nowTime=datetime.datetime.now().strftime("%Y-%m-%d-%H:%M:%S")
- nowTime=str(nowTime)+"---"+str(randomNum)
- LOGGER[y].append(coustomtxt)
- LOGGER[y].append(startDatekey+"-"+endDatekey)
- LOGGER[y].append(UrlDebugListlog)
- LOGGER[y].append(DebugCodeListlog)
- LOGGER[y].append(nowTime)
- LOGGER[y].append(ADMINKEYLISTlog)
- y=y+1
-
- LOGGER=pd.DataFrame(LOGGER)
- if len(LOGGER)>0:
- LOGGER.columns =["客戶","查詢區間","網址","狀態","查詢時間","帳號"]
- else:
- print("NO LOG")
- print(LOGGER)
- #===================================================================================
- end = time.time()
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理中...")
- #------------------------------------------------------------------------
- #neewDataFrmoe.to_csv("M126UI.csv",encoding="utf_8_sig")#for debug
- print("FILE明子...asdasdasd:"+thisfile)
-
- neewDataFrmoe.to_sql('後台外埔報表', con=engine3, if_exists='append')
- LOGGER.to_sql('LOG', con=engine3, if_exists='append')
-
-
-
- closedatalodibg=LoadingYesorNo()
- end = time.time()
- print("執行時間:%f 秒" % (end - start))
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理完成")
- print("DONE.....................100%")
- #window.close()
- app.quit()
-
- except Exception:
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
-
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('連線資料錯誤')
- app1.exec_()
- finally:
- closedatalodibg=LoadingYesorNo()
- class External3(QThread):
- """
- Runs a counter thread.
- """
- countChanged = pyqtSignal(int)#介面用進度條
- urlChanged=pyqtSignal(str)#介面用網址資訊
- def run(self):
- try:
- ALLDataFrameList=[]
- DebugCodeList=[]
- ALLDataFrameList.append(refindoutbet)
- ALLDataFrameList=pd.concat(ALLDataFrameList)
- #-----------------------------------------------------------------------------------------------
- #多執行續
- with ThreadPoolExecutor(max_workers=10) as executor:
- futures = []
- test=[]
- z=0
- x=len(UrlList)
- for urlkey,adminkey,passkey,backupUrl in zip(UrlList,AdminList,PasswordList,backupUrlList):
- future=executor.submit(BallGetData,urlkey,adminkey,passkey, startDatekey, endDatekey)
- futures.append(future)#已完成的
- for future in as_completed(futures):
- test.append(list(future.result()))
- MDF,MDC,MURL,ADMINNNNNN=list(future.result())
- #MDF=pd.concat([ALLDataFrameList,MDF])
- #MDF.to_sql('流水帳', con=engine3, if_exists='append')
- MDCURL=MURL+"=>"+MDC
- percentvalues=((z+1)/x)*100
- self.countChanged.emit(percentvalues)
- self.urlChanged.emit(MDCURL)
- z=z+1
- #-----------------------------------------------------------------------------------------------
-
- ALLDataFrameList0,DebugCodeList,UrlDebugList,ADMINKEYLIST=zip(*test)
- ALLDataFrameList0=pd.concat(ALLDataFrameList0)
- neewDataFrmoe=pd.concat([ALLDataFrameList,ALLDataFrameList0])
-
- print("newwwwww"+str(neewDataFrmoe))
-
-
- #-------------------------------------------------------------------------
- #=============================LOGER======================================
- LOGGER=[]
- y=0
- for UrlDebugListlog,DebugCodeListlog,ADMINKEYLISTlog in zip(UrlDebugList,DebugCodeList,ADMINKEYLIST):
- if DebugCodeListlog=="OK":
- print("OK")
- else:
- LOGGER.append([])
- randomNum=random.randint(0,9)
- nowTime=datetime.datetime.now().strftime("%Y-%m-%d-%H:%M:%S")
- nowTime=str(nowTime)+"---"+str(randomNum)
- LOGGER[y].append(coustomtxt)
- LOGGER[y].append(startDatekey+"-"+endDatekey)
- LOGGER[y].append(UrlDebugListlog)
- LOGGER[y].append(DebugCodeListlog)
- LOGGER[y].append(nowTime)
- LOGGER[y].append(ADMINKEYLISTlog)
- y=y+1
-
- LOGGER=pd.DataFrame(LOGGER)
- if len(LOGGER)>0:
- LOGGER.columns =["客戶","查詢區間","網址","狀態","查詢時間","帳號"]
- else:
- print("NO LOG")
- print(LOGGER)
- #===================================================================================
- end = time.time()
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理中...")
- #------------------------------------------------------------------------
- #neewDataFrmoe.to_csv("M126UI.csv",encoding="utf_8_sig")#for debug
- print("FILE明子...asdasdasd:"+thisfile)
-
- neewDataFrmoe.to_sql('流水帳', con=engine3, if_exists='append')
- LOGGER.to_sql('LOG', con=engine3, if_exists='append')
-
-
-
- closedatalodibg=LoadingYesorNo()
- end = time.time()
- print("執行時間:%f 秒" % (end - start))
- self.urlChanged.emit("已執行"+str(end - start)+"秒 處理完成")
- print("DONE.....................100%")
- #window.close()
- app.quit()
-
- except Exception:
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
-
- app1 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('連線資料錯誤')
- app1.exec_()
- finally:
- closedatalodibg=LoadingYesorNo()
-
- class Actions(QDialog):
-
- """
- Simple dialog that consists of a Progress Bar and a Button.
- Clicking on the button results in the start of a timer and
- updates the progress bar..
- """
- def __init__(self):
- super().__init__()
- self.initUI()
-
- def initUI(self):
- self.setWindowTitle('D0128')
- self.setWindowFlags(Qt.WindowStaysOnTopHint)
- self.progress = QProgressBar(self)
- self.progress.setGeometry(20, 20, 300, 25)
- self.progress.setMaximum(100)
- self.label=QLabel(self)
- self.label.setGeometry(20, 50, 211, 31)
- self.label.setText("- 自動導入中請勿關閉視窗 - ")
- self.label2=QLabel(self)
- self.label2.setGeometry(20, 70, 211, 31)
- self.show()
- self.calc = External()
- self.calc.countChanged.connect(self.onCountChanged)
- self.calc.urlChanged.connect(self.onUrlChanged)
- self.calc.start()
-
- def onCountChanged(self, value):
- self.progress.setValue(value)
- def onUrlChanged(self, urlstr):
- self.label2.setText(urlstr)
-
- class Actions2(QDialog):
-
- """
- Simple dialog that consists of a Progress Bar and a Button.
- Clicking on the button results in the start of a timer and
- updates the progress bar.
- """
- def __init__(self):
- super().__init__()
- self.initUI()
-
- def initUI(self):
- self.setWindowTitle('連線中...')
- self.label=QLabel(self)
- #self.label.setFont(QtGui.QFont('Arial', 12))
- self.label.setGeometry(20, 20,120,30)
- #self.label.setTextFormat(QtCore.Qt.AutoText)
- self.label.setText("- 取得連線 請按開始 -")
- self.button = QPushButton('開始', self)
- self.button.move(50, 80)
- self.show()
- self.button.clicked.connect(self.onButtonClick)
- def onButtonClick(self):
- self.close()
-
- class Actions3(QDialog):
-
- """
- Simple dialog that consists of a Progress Bar and a Button.
- Clicking on the button results in the start of a timer and
- updates the progress bar..
- """
- def __init__(self):
- super().__init__()
- self.initUI()
-
- def initUI(self):
- self.setWindowTitle('D0150')
- self.setWindowFlags(Qt.WindowStaysOnTopHint)
- self.progress = QProgressBar(self)
- self.progress.setGeometry(20, 20, 300, 25)
- self.progress.setMaximum(100)
- self.label=QLabel(self)
- self.label.setGeometry(20, 50, 211, 31)
- self.label.setText("- 自動導入中請勿關閉視窗 - ")
- self.label2=QLabel(self)
- self.label2.setGeometry(20, 70, 211, 31)
- self.show()
- self.calc = External2()
- self.calc.countChanged.connect(self.onCountChanged)
- self.calc.urlChanged.connect(self.onUrlChanged)
- self.calc.start()
-
- def onCountChanged(self, value):
- self.progress.setValue(value)
- def onUrlChanged(self, urlstr):
- self.label2.setText(urlstr)
- class Actions4(QDialog):
-
- """
- Simple dialog that consists of a Progress Bar and a Button.
- Clicking on the button results in the start of a timer and
- updates the progress bar..
- """
- def __init__(self):
- super().__init__()
- self.initUI()
-
- def initUI(self):
- self.setWindowTitle('D0230')
- self.setWindowFlags(Qt.WindowStaysOnTopHint)
- self.progress = QProgressBar(self)
- self.progress.setGeometry(20, 20, 300, 25)
- self.progress.setMaximum(100)
- self.label=QLabel(self)
- self.label.setGeometry(20, 50, 211, 31)
- self.label.setText("- 自動導入中請勿關閉視窗 - ")
- self.label2=QLabel(self)
- self.label2.setGeometry(20, 70, 211, 31)
- self.show()
- self.calc = External3()
- self.calc.countChanged.connect(self.onCountChanged)
- self.calc.urlChanged.connect(self.onUrlChanged)
- self.calc.start()
-
- def onCountChanged(self, value):
- self.progress.setValue(value)
- def onUrlChanged(self, urlstr):
- self.label2.setText(urlstr)
-
- try:
- #app1 = QApplication(sys.argv)
- #window2 = Actions2()
- FIle="A1.txt"
- FIle2="B.txt"
- FIle3="A2.txt"
-
- def LoadingYesorNo():
- SUPDA=db_session2.query(Someoneupdate).filter_by(正在自動導入中='YES').first()
- SUPDAc=db_session2.query(Someoneupdate).filter_by(正在自動導入中='YES').count()
- print(SUPDAc)
- if (SUPDAc==1):
- SUPDA.正在自動導入中='NO'
- db_session2.commit()
-
-
- coustomtxt,bdtxt=loadCSV()
-
- engine = create_engine('mssql+pyodbc://'+bdtxt+'?driver=SQL+Server+Native+Client+11.0')
-
- print (coustomtxt)
- engine3=connectEngine(coustomtxt,engine)
- '''
- @event.listens_for(engine3, 'before_cursor_execute')
- def receive_before_cursor_execute(conn, cursor, statement, params, context, executemany):
- if executemany:
- cursor.fast_executemany = True
- cursor.commit()
- '''
- DB_session2 = sessionmaker(engine3)
- db_session2= DB_session2()
- log_Engine=CreateLogEngine()
- while True:
- if os.path.isfile(FIle)==True:
- thisfile="A1.txt"
- os.remove(FIle)
- startDatekey,endDatekey,allpart=DateDataLoad(engine3,db_session2)
- contforloop,loopper2,childAdminLs,loopper3=LoadCustomData(engine3,allpart)
- UrlList,AdminList,PasswordList,backupUrlList=zip(*loopper2)
- #webselect="GameType%5B%5D=35&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101"
- print(UrlList,AdminList,PasswordList)#,webselect)
- start = time.time()
- # refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- # refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"])
- refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","大總監","系統商","隨機碼"])
- #refindoutbet=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","總量","退水","中獎","小計"])
-
- #window2.close()
- #app1.quit()
- #app1.exec_()
-
- app = QtWidgets.QApplication(sys.argv)
- window = Actions()
- app.exec_()
-
-
- del app
- del window
- #sys.exit(app.exec_())
-
- continue
- if os.path.isfile(FIle3)==True:
- thisfile="A2.txt"
- os.remove(FIle3)
- startDatekey,endDatekey,allpart=DateDataLoad(engine3,db_session2)
- contforloop,loopper2,childAdminLs,loopper3=LoadCustomData(engine3,allpart)
- UrlList,AdminList,PasswordList,backupUrlList=zip(*loopper2)
- print(UrlList,AdminList,PasswordList)
- start = time.time()
- # refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- # refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"])
- refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","大總監","系統商","隨機碼"])
- refindoutbet=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","總量","退水","中獎","小計","狀態"])
-
- #window2.close()
- #app1.quit()
- #app1.exec_()
-
- app = QtWidgets.QApplication(sys.argv)
- window = Actions()
- app.exec_()
-
-
- del app
- del window
- #sys.exit(app.exec_())
-
- app = QtWidgets.QApplication(sys.argv)
- window = Actions3()
- app.exec_()
- del app
- del window
-
- continue
- if os.path.isfile(FIle)==True:
- thisfile="A1.txt"
- os.remove(FIle)
- startDatekey,endDatekey,allpart=DateDataLoad(engine3,db_session2)
- contforloop,loopper2,childAdminLs,loopper3=LoadCustomData(engine3,allpart)
- UrlList,AdminList,PasswordList,backupUrlList=zip(*loopper2)
- #webselect="GameType%5B%5D=35&GameType%5B%5D=22&GameType%5B%5D=11&GameType%5B%5D=12&GameType%5B%5D=13&GroupType%5B%5D=118&GroupType%5B%5D=109&GroupType%5B%5D=108&GroupType%5B%5D=102&GroupType%5B%5D=160&GroupType%5B%5D=159&GroupType%5B%5D=158&GroupType%5B%5D=157&GroupType%5B%5D=156&GroupType%5B%5D=155&GroupType%5B%5D=154&GroupType%5B%5D=153&GroupType%5B%5D=107&GroupType%5B%5D=106&GroupType%5B%5D=105&GroupType%5B%5D=104&GroupType%5B%5D=103&GroupType%5B%5D=101"
- print(UrlList,AdminList,PasswordList)#,webselect)
- start = time.time()
- # refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- # refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","隨機碼"])
- refindlong=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","名稱","總量","退水","中獎","輸贏","佔成輸贏","水倍差","上繳金額","自已總輸贏","上繳貢獻額","貢獻額","貢獻度","下注明細","玩法明細","調盤退水","調退實佔","上繳","會員","代理","總代理","股東","大股東","總監"])
- refindshort=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","客戶s","總量s","中獎s","輸贏s","客戶小計s","代理小計s","總代理小計s","股東小計s","大股東小計s","總監小計s","個人所得s","水差s","下注明細s","查看對帳s","貢獻額s","貢獻度s","調盤退水s","調退實佔s","大總監","系統商","隨機碼"])
- #refindoutbet=pd.DataFrame(columns =["開始日期","結束日期","網址","帳戶","總量","退水","中獎","小計"])
- del app
- del window
- #window2.close()
- #app1.quit()
- #app1.exec_()
-
- app = QtWidgets.QApplication(sys.argv)
- window = Actions4()
- app.exec_()
-
-
- del app
- del window
- #sys.exit(app.exec_())
-
- continue
- if os.path.isfile(FIle2)==True:
- os.remove(FIle2)
- break
- time.sleep(1)
- #sys.exit()
-
- except:
- traceback.print_exc() # 捕捉異常,並將異常傳播資訊輸出控制檯
- traceback.print_exc(file=open('log.txt', 'a'))
- logging.debug('debug message',exc_info=True)
- logging.info('info message',exc_info=True)
- logging.warning('warning message',exc_info=True)
- logging.error('error message',exc_info=True)
- logging.critical('critical message',exc_info=True)
- app2 = QtWidgets.QApplication([])
- error_dialog = QtWidgets.QErrorMessage()
- error_dialog.setWindowTitle('ERROR')
- error_dialog.showMessage('網路DRIVER錯誤')
- app2.exec_()
-
- finally:
- closedatalodibg=LoadingYesorNo()
|