This is a simple python scraping for the Filmaffinity.

sergiormb, updated 🕥 2023-02-10 23:09:45

Python FilmAffinity


This is a simple python scraping for the FilmAffinity.

.. image:: https://github.com/sergiormb/python_filmaffinity/workflows/Tests/badge.svg?branch=master :target: https://github.com/sergiormb/python_filmaffinity/actions/workflows/python-test.yml?query=branch%3Amaster .. image:: https://img.shields.io/github/license/mashape/apistatus.svg
:target: https://github.com/sergiormb/python_filmaffinity/blob/master/LICENSE.rst .. image:: https://img.shields.io/pypi/pyversions/Django.svg
:target: https://pypi.python.org/pypi/python_filmaffinity/ .. image:: https://readthedocs.org/projects/python-filmaffinity/badge/?version=latest :target: http://python-filmaffinity.readthedocs.io/en/latest/?badge=latest

Installation

Pip


::

pip install python-filmaffinity

From Source


::

git clone [email protected]:sergiormb/python_filmaffinity.git
cd python_filmaffinity
python setup.py install

Requirements


::

requests >= 2.0.1
requests-cache >= 0.4.13
bs4 >= 0.0.1

Examples

.. code-block:: python

import python_filmaffinity
service = python_filmaffinity.FilmAffinity()
movie = service.get_movie(title='Celda 211')
movie['title']
Celda 211
movie['rating']
7.7
movie['directors']
['Daniel Monzón']
movie['actors']
['Luis Tosar', 'Alberto Ammann', 'Antonio Resines', 'Carlos Bardem', 'Marta Etura', 'Vicente Romero', 'Manuel Morón', 'Manolo Solo', 'Fernando Soto', 'Luis Zahera', 'Patxi Bisquert', 'Félix Cubero', 'Josean Bengoetxea', 'Juan Carlos Mangas', 'Jesús Carroza']

Usage

language


  • Spanish: 'es'
  • USA, UK: 'en'
  • México: 'mx'
  • Argentina: 'ar'
  • Chile: 'cl'
  • Colombia: 'co'

  • Example

.. code-block:: python

import python_filmaffinity
service = python_filmaffinity.FilmAffinity(lang='en')

search


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | title | False | String | Search for the title of the movie | +-----------+----------+--------+-----------------------------------+ | cast | False | String | Search movies by actor | +-----------+----------+--------+-----------------------------------+ | director | False | String | Search movies by the director | +-----------+----------+--------+-----------------------------------+ | from_year | False | String | Search start date | +-----------+----------+--------+-----------------------------------+ | to_year | False | String | Search end date | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.search(cast='Nicolas Cage')

get_movie


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | id | False | String | FilmAffinity id | +-----------+----------+--------+-----------------------------------+ | title | False | String | Get movie by title | +-----------+----------+--------+-----------------------------------+ | trailer | False | Boolean| Return movie with trailer | +-----------+----------+--------+-----------------------------------+ | images | False | Boolean| Return movie with images | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.get_movie(title='Avatar')
movies = service.get_movie(id='495280')

top_filmaffinity


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | from_year | False | String | Search start date | +-----------+----------+--------+-----------------------------------+ | to_year | False | String | Search end date | +-----------+----------+--------+-----------------------------------+ | top | False | Integer| Number of elements | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.top_filmaffinity()
movies = service.top_filmaffinity(from_year=2010, to_year=2011)

top_premieres


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | top | False | Integer| Number of elements | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.top_premieres()

top_netflix, top_hbo, top_filmin, top_movistar, top_rakuten, top_tv_series


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | top | False | Integer| Number of elements | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.top_netflix()
movies = service.top_hbo(top=5)
movies = service.top_filmin()
movies = service.top_movistar()
movies = service.top_rakuten()
movies = service.top_tv_series()

recommend HBO, Netflix, Filmin, Movistar, Rakuten


+-----------+----------+--------+-----------------------------------+ | Parameter | Required | Type | Description | +===========+==========+========+===================================+ | trailer | False | Boolean| Return movie with trailer | +-----------+----------+--------+-----------------------------------+ | images | False | Boolean| Return movie with images | +-----------+----------+--------+-----------------------------------+

  • Example

.. code-block:: python

movies = service.recommend_netflix()
movies = service.recommend_hbo()
movies = service.recommend_filmin()
movies = service.recommend_movistar()
movies = service.recommend_rakuten()

Changelog

v0.0.19 (22-06-2021)


  • Fixed errors in get_country

v0.0.18 (26-02-2021)


  • When images are requested, lets provide also the country where they were published (@jcea)
  • Correctly provide the trailers listed in filmaffinity (@jcea)
  • Spurious search in youtube deleted (@jcea)
  • Extract correctly when multiple genres (@jcea)
  • Added "writers", "music", "cinematography" and "producers" (@jcea)
  • Regression processing "original_title" in searches (@jcea)

v0.0.17 (18-02-2021)


  • Deleted spaces at the end of the title (@jcea)
  • Added original_title (@jcea)
  • Fix directors scraping (@jcea)

v0.0.15 (03-08-2020)


  • Search by genre

v0.0.14 (08-09-2018)


  • Fixed errors

v0.0.13 (07-09-2018)


  • Adds proxies and random user-agent in headers

v0.0.12 (27-08-2018)


  • Changed description

v0.0.11 (27-08-2018)


  • Fixed errors

v0.0.1O (27-08-2018)


  • Fixed errors with SSL

v0.0.09 (28-12-2017)


  • Replaces cachetools for requests-cache

v0.0.8 (26-12-2017)


  • Add images
  • Fixed errors

v0.0.7 (15-12-2017)


  • Fixes encoding for the analyzed results
  • Disabled limitations for all the supported languages
  • Change of name to the main class.
  • Adds initial language check and raise error if this is not in support
  • Adds basic exceptions

v0.0.6 (12-06-2017)


  • Add cachetools

v0.0.5 (13-06-2017)


  • Fixed errors

v0.0.4 (11-06-2017)


  • Top new DVDs
  • Get movie with trailer
  • Top TV series
  • Return movies list with raiting

v0.0.3 (10-06-2017)


  • Top Netlfix, HBO and Filmin
  • Recommendation from Netflix, HBO or Filmin
  • Fixed errors

v0.0.2 (31-05-2017)


  • Search movies by title, year, director or cast.
  • Get the filmaffinity top and search by year
  • Get the premieres top

v0.0.1 (29-05-2017)


  • Initial release.

Authors


Lead

Collaborators

  • opacam https://github.com/opacam
  • jcea - https://www.jcea.es/ - https://blog.jcea.es/ - https://github.com/jcea

License

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Issues

Bump ipython from 7.16.3 to 8.10.0

opened on 2023-02-10 23:09:45 by dependabot[bot]

Bumps ipython from 7.16.3 to 8.10.0.

Release notes

Sourced from ipython's releases.

See https://pypi.org/project/ipython/

We do not use GitHub release anymore. Please see PyPI https://pypi.org/project/ipython/

Commits
  • 15ea1ed release 8.10.0
  • 560ad10 DOC: Update what's new for 8.10 (#13939)
  • 7557ade DOC: Update what's new for 8.10
  • 385d693 Merge pull request from GHSA-29gw-9793-fvw7
  • e548ee2 Swallow potential exceptions from showtraceback() (#13934)
  • 0694b08 MAINT: mock slowest test. (#13885)
  • 8655912 MAINT: mock slowest test.
  • a011765 Isolate the attack tests with setUp and tearDown methods
  • c7a9470 Add some regression tests for this change
  • fd34cf5 Swallow potential exceptions from showtraceback()
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/sergiormb/python_filmaffinity/network/alerts).

Bump setuptools from 49.2.1 to 65.5.1

opened on 2022-12-27 15:39:55 by dependabot[bot]

Bumps setuptools from 49.2.1 to 65.5.1.

Release notes

Sourced from setuptools's releases.

v65.5.1

No release notes provided.

v65.5.0

No release notes provided.

v65.4.1

No release notes provided.

v65.4.0

No release notes provided.

v65.3.0

No release notes provided.

v65.2.0

No release notes provided.

v65.1.1

No release notes provided.

v65.1.0

No release notes provided.

v65.0.2

No release notes provided.

v65.0.1

No release notes provided.

v65.0.0

No release notes provided.

v64.0.3

No release notes provided.

v64.0.2

No release notes provided.

v64.0.1

No release notes provided.

v64.0.0

No release notes provided.

v63.4.3

No release notes provided.

v63.4.2

No release notes provided.

... (truncated)

Changelog

Sourced from setuptools's changelog.

v65.5.1

Misc ^^^^

  • #3638: Drop a test dependency on the mock package, always use :external+python:py:mod:unittest.mock -- by :user:hroncok
  • #3659: Fixed REDoS vector in package_index.

v65.5.0

Changes ^^^^^^^

  • #3624: Fixed editable install for multi-module/no-package src-layout projects.
  • #3626: Minor refactorings to support distutils using stdlib logging module.

Documentation changes ^^^^^^^^^^^^^^^^^^^^^

  • #3419: Updated the example version numbers to be compliant with PEP-440 on the "Specifying Your Project’s Version" page of the user guide.

Misc ^^^^

  • #3569: Improved information about conflicting entries in the current working directory and editable install (in documentation and as an informational warning).
  • #3576: Updated version of validate_pyproject.

v65.4.1

Misc ^^^^

v65.4.0

Changes ^^^^^^^

v65.3.0

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/sergiormb/python_filmaffinity/network/alerts).

Bump certifi from 2020.6.20 to 2022.12.7

opened on 2022-12-08 10:53:19 by dependabot[bot]

Bumps certifi from 2020.6.20 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/sergiormb/python_filmaffinity/network/alerts).

Warning when connecting to the sslproxies

opened on 2021-02-18 00:02:26 by jcea

I get this warning, repeated several times:

/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.sslproxies.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

Releases

0.0.19 2021-06-22 06:41:50

  • Fixed errors in get_country

0.0.18 2021-02-26 09:49:14

  • When images are requested, lets provide also the country where they were published (@jcea)
  • Correctly provide the trailers listed in filmaffinity (@jcea)
  • Spurious search in youtube deleted (@jcea)
  • Extract correctly when multiple genres (@jcea)
  • Added "writers", "music", "cinematography" and "producers" (@jcea)
  • Regression processing "original_title" in searches (@jcea)

0.0.17 2021-02-18 07:24:25

Deleted spaces at the end of the title (@jcea) Added original_title (@jcea)

0.0.16 2020-08-04 12:55:54

0.0.15 2020-08-04 07:59:33

2018-10-07 19:41:21

v0.0.13 (07-09-2018)


  • Adds proxies and random user-agent in headers
Sergio Pino Márquez

Python/Django Backend developer en @aplazame

GitHub Repository Homepage