1+ # (C) 2019-2020 lifegpc
2+ # This file is part of bili.
3+ #
4+ # This program is free software: you can redistribute it and/or modify
5+ # it under the terms of the GNU General Public License as published by
6+ # the Free Software Foundation, either version 3 of the License, or
7+ # (at your option) any later version.
8+ #
9+ # This program is distributed in the hope that it will be useful,
10+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ # GNU General Public License for more details.
13+ #
14+ # You should have received a copy of the GNU General Public License
15+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
116import biliDanmuDown
217from os .path import exists
318from os import mkdir ,remove
1025import biliLogin
1126import biliDanmuAuto
1227import file
28+ from JSONParser import getset
1329def downloadh (filen ,r ,pos ,da ) :
1430 d = biliDanmuDown .downloadh (pos ,r ,biliTime .tostr (biliTime .getDate (da )))
1531 if d == - 1 :
@@ -227,7 +243,7 @@ def DanmuGetn(c,data,r,t,xml,xmlc,ip) :
227243 print ('保存文件失败' + filen )
228244 return - 2
229245 return 0
230- def DanmuGeta (c ,data ,r ,t ,xml ,xmlc ,ip ) :
246+ def DanmuGeta (c ,data ,r ,t ,xml ,xmlc ,ip : dict , se : dict ) :
231247 "全弹幕处理"
232248 try :
233249 if not exists ('Download' ) :
@@ -244,8 +260,18 @@ def DanmuGeta(c,data,r,t,xml,xmlc,ip) :
244260 if t == 'av' :
245261 bs = True
246262 at2 = False
263+ fi = True
264+ jt = False
265+ if getset (se ,'jt' )== True :
266+ jt = True
247267 while bs :
248- at = input ('请输入两次抓取之间的天数(1-365),输入a启动自动模式(可能有点傻)' )
268+ if fi and 'jt' in ip :
269+ fi = False
270+ at = ip ['jt' ]
271+ elif jt :
272+ at = 'a'
273+ else :
274+ at = input ('请输入两次抓取之间的天数(1-365),输入a启动自动模式(可能有点傻)' )
249275 if at .isnumeric () and int (at )<= 365 and int (at )>= 1 :
250276 at = int (at )
251277 bs = False
@@ -563,8 +589,20 @@ def DanmuGeta(c,data,r,t,xml,xmlc,ip) :
563589 bs = True
564590 at2 = False
565591 pubt = data ['mediaInfo' ]['time' ][0 :10 ]
592+ fi = True
593+ jt = False
594+ if getset (se ,'jt' )== True :
595+ jt = True
596+ if 'jts' in ip :
597+ pubt = ip ['jts' ]
566598 while bs :
567- at = input ('请输入两次抓取之间的天数(1-365),输入a启动自动模式(可能有点傻),输入b手动输入日期(当前日期:%s)' % (pubt ))
599+ if fi and 'jt' in ip :
600+ fi = False
601+ at = ip ['jt' ]
602+ elif jt :
603+ at = 'a'
604+ else :
605+ at = input ('请输入两次抓取之间的天数(1-365),输入a启动自动模式(可能有点傻),输入b手动输入日期(当前日期:%s)' % (pubt ))
568606 if at .isnumeric () and int (at )<= 365 and int (at )>= 1 :
569607 at = int (at )
570608 bs = False
0 commit comments