barmac / film-ratings

A web browser extension which displays FilmWeb ratings on HBO Go and Netflix.
1 stars 0 forks source link

Use FilmWeb API #3

Open lukaszmn opened 2 years ago

lukaszmn commented 2 years ago

I'm afraid it's not working, film ratings are not contained in the results page but have to be requested with API: https://www.filmweb.pl/api/v1/film/<ID>/rating

barmac commented 2 years ago

Hi @lukaszmn,

Thanks for creating the issue. I wasn't aware of the API provided by FilmWeb. While the web scraping based solution still works for me (cf. attached screenshot), I think it's a great idea to switch to use the API. Do you know if there is an endpoint to do the film search? We need to have the film ID in order to fetch the rating. Otherwise, we could use http://www.filmweb.pl/search/live?q=nazwa as suggested at https://kodi.org.pl/forum/7-xbmc-toolbox-xtb/2612-filmweb-api/

image
barmac commented 2 years ago

So for http://www.filmweb.pl/search/live?q=%C5%81owca%20Jeleni, it returns search results:

f\c1045\c/10/45/1045/7563795.6.jpg\cThe Deer Hunter\cŁowca jeleni\cЛовецът на елени\c1978\cRobert De Niro, John Cazale\af\c734\c/07/34/734/7899618.6.jpg\cBlade Runner\cŁowca androidów\cБлейд Рънър\c1982\cHarrison Ford, Rutger Hauer\af\c600541\c/05/41/600541/7450957.6.jpg\cSnow White and the Huntsman\cKrólewna Śnieżka i Łowca\cСнежанка и ловецът\c2012\cKristen Stewart, Chris Hemsworth\af\c684721\c/47/21/684721/7729202.6.jpg\cThe Huntsman: Winter's War\cŁowca i Królowa Lodu\cالصياد: حرب الشتاء\c2016\cChris Hemsworth, Charlize Theron\af\c15\c/00/15/15/7046391.6.jpg\cBlade\cBlade - Wieczny łowca\cБлейд\c1998\cWesley Snipes, Stephen Dorff\af\c644817\c/48/17/644817/7707670.6.jpg\cThe Last Witch Hunter\cŁowca czarownic\cصائد الساحرات اﻷخير\c2015\cVin Diesel, Rose Leslie\ap\c163454\c/34/54/163454/452568.2.jpg\cAllen Leech\c2\c6\cDownton Abbey 2010\c\af\c4225\c/42/25/4225/7538074.6.jpg\cBlade II\cBlade: Wieczny łowca II\cБлейд 2\c2002\cWesley Snipes, Kris Kristofferson\af\c563280\c/32/80/563280/7560112.6.jpg\cAbraham Lincoln: Vampire Hunter\cAbraham Lincoln: Łowca wampirów 3D\cЕйбрахам Линкълн: Ловецът на вампири\c2012\cBenjamin Walker, Dominic Cooper\af\c33417\c/34/17/33417/7535667.6.jpg\cDreamcatcher\cŁowca snów\cPavučina snů\c2003\cMorgan Freeman, Thomas Jane

The 1045 in the beginning is the ID I was looking for. So it seems to be a good starting point in order to ditch web scraping.