Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0cb3987380
14
Common.py
14
Common.py
@ -257,26 +257,20 @@ def appendError(obj):
|
||||
class downloader(XiGuaLiveApi):
|
||||
playlist = None
|
||||
|
||||
def updRoomInfo(self):
|
||||
global broadcaster, isBroadcasting, updateTime, forceNotBroadcasting, forceNotDownload
|
||||
super(downloader, self).updRoomInfo()
|
||||
def _updateRoomOnly(self):
|
||||
global broadcaster, isBroadcasting, updateTime
|
||||
super(downloader, self)._updateRoomOnly()
|
||||
updateTime = datetime.strftime(datetime.now(), dt_format)
|
||||
broadcaster = self.roomLiver
|
||||
isBroadcasting = self.isLive
|
||||
if self.isLive:
|
||||
self.updPlayList()
|
||||
else:
|
||||
forceNotDownload = False
|
||||
forceNotBroadcasting = False
|
||||
self.playlist = False
|
||||
|
||||
def updPlayList(self):
|
||||
global streamUrl
|
||||
if self.isLive:
|
||||
if "stream_url" in self._rawRoomInfo:
|
||||
if self.playlist is None:
|
||||
self.playlist = None
|
||||
else:
|
||||
if self.isLive and "stream_url" in self._rawRoomInfo:
|
||||
self.playlist = self._rawRoomInfo["stream_url"]["flv_pull_url"]
|
||||
self.playlist = self.playlist.replace("_uhd", "").replace("_sd", "").replace("_ld", "")
|
||||
streamUrl = self.playlist
|
||||
|
@ -10,8 +10,6 @@ from liveDownloader import run as RUN
|
||||
app = Flask(__name__)
|
||||
app.config['JSON_AS_ASCII'] = False
|
||||
CORS(app, supports_credentials=True)
|
||||
# url_for('static', filename='index.html')
|
||||
# url_for('static', filename='index.js')
|
||||
|
||||
|
||||
@app.route("/")
|
||||
|
@ -191,7 +191,6 @@ if __name__ == "__main__":
|
||||
resetColor()
|
||||
time.sleep(60)
|
||||
api.updRoomInfo()
|
||||
sys.exit()
|
||||
print("进入", api.roomLiver, "的直播间")
|
||||
os.system("title {}".format(api.getTitle()))
|
||||
print("=" * 30)
|
||||
|
1
api.py
1
api.py
@ -145,7 +145,6 @@ class XiGuaLiveApi:
|
||||
"""
|
||||
if self.name is None or self.roomLiver is None:
|
||||
return False
|
||||
if self.name in self.roomLiver:
|
||||
return True
|
||||
|
||||
def _forceSearchUser(self):
|
||||
|
@ -26,8 +26,8 @@ def download():
|
||||
isDownload = True
|
||||
Common.appendDownloadStatus("Download >{}< Start".format(path))
|
||||
f = open(path, "wb")
|
||||
try:
|
||||
_size = 0
|
||||
try:
|
||||
for t in p.iter_content(chunk_size=64 * 1024):
|
||||
if Common.forceNotDownload:
|
||||
Common.modifyLastDownloadStatus("Force Stop Download".format(path))
|
||||
|
Reference in New Issue
Block a user