Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding missing exception clause #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jupiterbjy
Copy link

livemonitor/spider.py

Lines 1025 to 1037 in 27a7852

def run(self):
while not self.stop_now:
try:
chaturl = gettwitcastchaturl(self.tgt, self.cookies, self.proxy)
writelog(self.logpath,
'[Info] "%s" gettwitcastchaturl %s: %s' % (self.name, self.tgt, chaturl))
writelog(self.logpath, '[Success] "%s" gettwitcastchaturl %s' % (self.name, self.tgt))
except:
printlog('[Error] "%s" gettwitcastchaturl %s: %s' % (self.name, self.tgt, e))
writelog(self.logpath, '[Error] "%s" gettwitcastchaturl %s: %s' % (self.name, self.tgt, e))
time.sleep(5)
continue

This try - except does not define e nor global scope does, possibly a missing except Exception as e?

@jupiterbjy jupiterbjy changed the title Added missing exception clause Adding missing exception clause Jun 1, 2021
@jupiterbjy
Copy link
Author

Additionally I found following warnings with pylint:

  • Statement seems to have no effect - chat_item['item']['name']

    livemonitor/spider.py

    Lines 1010 to 1012 in 27a7852

    if 'item' in chat_item:
    chat_item['item']['name']
    chat_type += ' %s' % chat_item['item']['name']

  • Parameter 'proxy' unfilled - You might have missed cookies positional parameter.

From what I see ignature was:

def getyoutubevideostatus(video_id, cookies, proxy) -> str:

But was supplied only 2 of it:

if getyoutubevideostatus(url.replace("https://youtu.be/", ""), self.proxy) == "开始":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant