Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from Dawnnnnnn/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
yjqiang authored Apr 1, 2018
2 parents 6faf4db + d01aa56 commit d488d58
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions bilibiliCilent.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ async def parseDanMu(self, messages):
self.printer.printlist_append(['join_lottery','小电视','user', "# error", response.json()])
if cmd == 'GUARD_MSG':
try:
print(dic)
a = re.compile(r"(?<=在主播 )\S+(?= 的直播间开通了总督)")
res = a.findall(dic)
res = a.findall(str(dic))
search_url = "https://search.bilibili.com/api/search?search_type=live&keyword=" + str(res[0])
response = requests.get(search_url)
roomid = response.json()['result']['live_user'][0]['roomid']
Expand Down
3 changes: 0 additions & 3 deletions conf/user.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ danmu = user
普通送礼提示 = True
弹幕 = False




2 changes: 1 addition & 1 deletion configloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def load_color(self, file):

def load_user(self, file):
cf_user = configparser.ConfigParser()
# cf_user.read(file)
#cf_user.read(file)
cf_user.read_file(codecs.open(file, "r", "utf8"))
# print(cf_user._sections['platform']['platform'])
dic_user = cf_user._sections
Expand Down
5 changes: 3 additions & 2 deletions login.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import configparser
from urllib import parse
import time
import codecs


class Login():
Expand Down Expand Up @@ -32,10 +33,10 @@ def success(self):
username = input("输入用户名:")
password = input("输入密码:")
config = configparser.ConfigParser()
config.read("conf/user.conf")
config.read_file(codecs.open("conf/user.conf", "r", "utf8"))
config.set('account','username',username)
config.set('account','password',password)
config.write(open("conf/user.conf", "w+"))
config.write(codecs.open("conf/user.conf", "w+","utf8"))
if username != "":
value = self.GetHash()
key = value['key']
Expand Down

0 comments on commit d488d58

Please sign in to comment.