sockspls / hltv-api Goto Github PK
View Code? Open in Web Editor NEWProvides an API for HLTV
License: GNU Affero General Public License v3.0
Provides an API for HLTV
License: GNU Affero General Public License v3.0
Sorry - this isn't really an issue but I couldn't find a better way to ask this question.
Great tool thank you!
get_parsed_page seems to be getting blocked by cloudfare.
Thats right now not possible, because the page.find will get a NoneType return value.
py -3 .\HLTVbot.py
[{'date': '2022-06-01', 'url': '/matches/2356290/iem-dallas-2022-group-b-upper-bracket-semi-final-2-iem-dallas-2022', 'time': '02:00', 'event': b'ESL Challenger League Season 41 North America', 'team1': b'Unjustified', 'team2': b'ATK'}]
Think hltv did some changes to the team pages, so the _findTeamId helper is broken
hltv.get_results()
[{'url': 'https://hltv.org/matches/2366926/ence-vs-alliance-blast-premier-fall-showdown-2023-europe', 'match-id': 2366926, 'date': '5/10/2023', 'event': 'BLAST Premier Fall Showdown 2023 Europe', 'team1': 'ENCE', 'team1score': 2, 'team1-id': None, 'team2': 'Alliance', 'team2-id': None, 'team2score': 0}, {'url': 'https://hltv.org/matches/2366925/9ine-vs-big-blast-premier-fall-showdown-2023-europe', 'match-id': 2366925, 'date': '5/10/2023', 'event': 'BLAST Premier Fall Showdown 2023 Europe', 'team1': '9INE', 'team1score': 0, 'team1-id': None, 'team2': 'BIG', 'team2-id': None, 'team2score': 2}, {'url': 'https://hltv.org/matches/2366929/imperial-vs-party-astronauts-blast-premier-fall-showdown-2023-americas', 'match-id': 2366929, 'date': '5/10/2023', 'event': 'BLAST Premier Fall Showdown 2023 Americas', 'team1': 'Imperial', 'team1score': 0, 'team1-id': None, 'team2': 'Party Astronauts', 'team2-id': None, 'team2score': 2}, {'url': 'https://hltv.org/matches/2367149/space-vs-forward-winline-insight-season-4', 'match-id': 2367149, 'date': '2023-10-04', 'event': 'Winline Insight Season 4', 'team1': 'Space', 'team1score': 2, 'team1-id': None, 'team2': 'Forward', 'team2-id': None, 'team2score': 0}, {'url': 'https://hltv.org/matches/2367116/mouz-nxt-vs-pge-turow-cct-east-europe-series-3-closed-qualifier', 'match-id': 2367116, 'date': '2023-10-04', 'event': 'CCT East Europe Series 3 Closed Qualifier', 'team1': 'MOUZ NXT', 'team1score': 2, 'team1-id': None, 'team2': 'PGE Turow', 'team2-id': None, 'team2score': 0},
hltv.top5teams()
[{'id': None, 'name': 'Vitality', 'url': 'https://hltv.org/team/9565/vitality'}, {'id': None, 'name': 'ENCE', 'url': 'https://hltv.org/team/4869/ence'}, {'id': None, 'name': 'G2', 'url': 'https://hltv.org/team/5995/g2'}, {'id': None, 'name': 'Heroic', 'url': 'https://hltv.org/team/7175/heroic'}, {'id': None, 'name': 'MOUZ', 'url': 'https://hltv.org/team/4494/mouz'}]
HLTV matches page updated, so the function needs too. Temporary solution(returns matches for today):
def get_matches():
matches = get_parsed_page("http://www.hltv.org/matches/")
matches_list = []
upcoming = matches.find("div", {"class": "upcomingMatchesContainer"})
todaymatches = upcoming.find_all("div", {"class": "upcomingMatchesSection"})[0]
for i in todaymatches.find_all("div", {"class": "upcomingMatch"}):
team1 = str(i.find("div", {"class": "matchTeam team1"}).find("div", {"class": "matchTeamName text-ellipsis"}))[41:-6]
team2 = str(i.find("div", {"class": "matchTeam team2"}).find("div", {"class": "matchTeamName text-ellipsis"}))[41:-6]
time = str(i.find("div", {"class": "matchTime"}))[74:-6]
matches_list.append({'team1': team1, 'team2': team2, 'time': time})
return matches_list
Hey guys, im trying to up a Pull Request, with this feature, if you guys likes it, i want to contribute with the project. but dont have permission.
the matches will displayed on get_team_info
method, with a new property called matches
, which give us, the id and name of both teams, the confront name, and the name of the event
{ ...,
'matches': [{'championship': 'ESL Pro League Season 16',
'confront_name': 'FURIA X Eternal Fire',
'date': '21/09/2022',
'full_time': '21/09/2022 at 16:00',
'teams': {'team_1': 'FURIA',
'team_1_id': '8297',
'team_2': 'Eternal Fire',
'team_2_id': '11251'},
'time': '16:00'},
{'championship': 'ESL Pro League Season 16',
'confront_name': 'FURIA X Movistar Riders',
'date': '22/09/2022',
'full_time': '22/09/2022 at 16:00',
'teams': {'team_1': 'FURIA',
'team_1_id': '8297',
'team_2': 'Movistar Riders',
'team_2_id': '7718'},
'time': '16:00'}],
...,
}
HLTV is detecting it as an email address because of the @ in the name, and the workaround we have only works for his name right now. I'll look into it, maybe they store the name somewhere else
Hey man,
Wasn't sure how to contact you, so thought this would be a good way!
I recently forked your HLTV API and used it a small starter project of mine and wanted to make sure you're happy with me using it?
Also to say thank you for creating it! I was trying to do similar but my execution was no where near as good as yours!
Anyway hope everything is good for you, considering all that's going on!
If you want to get back to me, my email is [email protected]
Take it easy!
Matthew
HLTV API, is there a way to get the SteamID of the players?
Example, HLTV top 100 teams and from these 100 teams get the steamID of all 5 players of each team. Is something like this possible?
Or HLTV does not have this information?
Hi,
first of all thank you for this cool scraper.
Would it be possible to get the K/D (Headshots) etc. for every map of a match?
for example:
https://www.hltv.org/stats/matches/65090/fnatic-vs-nip
thank you and greetings.
Hello. i ran into a problem. When I call get_matches() , I get the "Just a moment..." page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.