Giter Club home page Giter Club logo

Comments (8)

panzarino avatar panzarino commented on August 25, 2024

@Hisairnessag3 It appears that the game id is invalid, or there is no way to get data for that game. Either way, it appears that mlb does not have any stats information for that game id. My guess is that the game was cancelled (or something of the like) and therefore does not have any stats data.

from mlbgame.

Hisairnessag3 avatar Hisairnessag3 commented on August 25, 2024

uh, I would take a look.

this code breaks with the same error:

def year_games(year):
y = mlbgame.games(year)
games = mlbgame.combine_games(y)
for game in games:
print (game.game_id)

return games

games = year_games(2017)
for game in games:

stats = mlbgame.player_stats(game.game_id)
for player in stats.home_batting:
    print(player.h)

latest version as well. Have tried the individual game ids also obviously.

from mlbgame.

panzarino avatar panzarino commented on August 25, 2024

@Hisairnessag3 Can you tell me what the game_status is for the games that are breaking?

from mlbgame.

Hisairnessag3 avatar Hisairnessag3 commented on August 25, 2024

FINAL

from mlbgame.

trevor-viljoen avatar trevor-viljoen commented on August 25, 2024

It's an issue with GAME_URL. There is an extra / added which creates an invalid URL.

from mlbgame.

trevor-viljoen avatar trevor-viljoen commented on August 25, 2024

It looks like MLB made some changes to how they serve out the files. You can no longer browse directory structure of gd2.mlb.com. If you request the url with the extra /, you get something like this:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>
gameday/components/game/mlb/year_2014/month_06/day_07//gid_2014_06_07_miamlb_chnmlb_1/boxscore.xml
</Key>

If you remove the extra /, you can retrieve the file. Another option is to use: http://gd-terr-origin.mlb.com/components/game/mlb/ instead of http://gd2.mlb.com/coponents/game/mlb/.

from mlbgame.

panzarino avatar panzarino commented on August 25, 2024

Fixed in #51 and will be included in the next release coming soon.

from mlbgame.

cBrou avatar cBrou commented on August 25, 2024

Work around for anyone looking to continue pulling the yearly Batting and Pitching files... Add an extra forward slash / at the end of the URI

http://gd2.mlb.com/components/game/mlb/year_2018/batters//

from mlbgame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.