Skip to content

Commit

Permalink
Merge pull request #9 from dmham187/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
schwalle authored Aug 21, 2021
2 parents 159c2a8 + 7d28c5e commit 9fc6bd9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
kicktipp-betbot
===============

A tool to palce bets on www.kicktipp.de automatically
A tool to place bets on www.kicktipp.de automatically

kicktipp-betbot is a python based command-line tool that will place bets on www.kicktipp.de for you.

Expand Down Expand Up @@ -82,7 +82,7 @@ $ kicktippbb.py --use-login-token c3HfazFh6sd mycommunityname
04.10.2020 18:00 'FC Bayern München' vs. 'Hertha BSC' (1.16;8.5;14.5) - skipped, already placed 3:1
...
```
Specifying the ```--overide-bets``` option will ignore already placed bets and override former placed bets.
Specifying the ```--override-bets``` option will ignore already placed bets and override former placed bets.

#### Matchday
If you like to place bets on a specific matchday you can use the ```--matchday``` option.
Expand Down
12 changes: 9 additions & 3 deletions kicktippbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
--matchday <value> Choose a specific matchday in the range of 1 to 34 to place bets on
"""

import sys
import datetime
import getpass
import re
Expand Down Expand Up @@ -107,8 +108,12 @@ def parse_match_rows(browser: RoboBrowser, community, matchday = None):
'input', id=lambda x: x and x.endswith('_heimTipp'))
gasttipp = row[3].find(
'input', id=lambda x: x and x.endswith('_gastTipp'))
match = Match(row[1].get_text(), row[2].get_text(), row[0].get_text(
), row[4].get_text(), row[5].get_text(), row[6].get_text())
try:
match = Match(row[1].get_text(), row[2].get_text(), row[0].get_text(
), row[4].get_text().replace("/",""), row[5].get_text().replace("/",""), row[6].get_text())
except:
print("Error: Not enough data, maybe there are no rates yet.")
sys.exit()
if not match.match_date:
match.match_date = lastmatch.match_date
lastmatch = match
Expand All @@ -121,6 +126,7 @@ def get_tippabgabe_url(community, matchday = None):
if matchday is None:
return tippabgabeurl
else:
matchday = int(matchday)
if matchday < 1 or matchday > 34:
raise IndexError("The matchday '{}' is not valid, use only 1 to 34!".format(matchday))
return tippabgabeurl + '?&spieltagIndex={matchday}'.format(matchday=matchday)
Expand Down Expand Up @@ -222,7 +228,7 @@ def choose_predictor(predictor_param, predictors):


def main(arguments):
browser = RoboBrowser(parser="html.parser")
browser = RoboBrowser(parser="html5lib")

validate_arguments(arguments)
predictors_ = predictors.base.get_predictors()
Expand Down

0 comments on commit 9fc6bd9

Please sign in to comment.