maksimhorowitz / nflscrapR

R Package for Scraping and Aggregating NFL Data
522 stars 139 forks source link

Nulls in string in scrape_game_ids #133

Open randomjohn opened 4 years ago

randomjohn commented 4 years ago

This issue just started a few days ago. When I use scrape_game_ids (and formerly season_games), I get an error message.

nfl_2019_games_tbl <- scrape_game_ids(2019) Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : embedded nul in string: <a bunch of stuff including \0>

aetedford commented 4 years ago

same.

generaljk commented 4 years ago

Same. Happened to me a few times last week as well until it randomly worked. It hasn't worked for me this week though. I think it may be something to do with NFL.com.

crbravens23 commented 4 years ago

Same but I get error when trying to update season data w scrape season function. I’ve tried so many things but no luck.

randomjohn commented 4 years ago

Made some progress on this. I copied the function to a new function and used the jsonlite version, and it works for the most part, except the NFL site goes on the fritz and sometimes returns nothing.

austingrosel commented 4 years ago

I haven't looked into the game_ids, but I had a similar issue with bringing in the play by play, and I think I may have figured out a work around...no idea if this is stable long term. Using https://github.com/opensdmx/rsdmx/issues/139 as a resource, I added encoding = "gzip" into the RJSONIO::fromJSON(RCurl::getURL(game_url)) command of the scrape_json_play_by_play function of the scrape_play_by_play.R file. So it looks like this: RJSONIO::fromJSON(RCurl::getURL(game_url, encoding = "gzip")) I was able to get a working version of the week 9 games updated into my play history.

randomjohn commented 4 years ago

Looks like the temporary fix as of 11/6 works, but I agree with the commit comment :(

How long until the NFL changes the API again for fun and profit?

woodstockwins commented 4 years ago

Is there a temp fix for game_play_by_play or only scrape_json_play_by_play? The formatting between the two is drastically different.