Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[metadata.tvmaze@matrix] 1.3.6 #549

Open
wants to merge 1 commit into
base: matrix
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions metadata.tvmaze/addon.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="metadata.tvmaze"
name="TVmaze"
version="1.3.5"
version="1.3.6"
provider-name="Roman V.M.">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="xbmc.metadata" version="2.1.0"/>
<import addon="script.module.simple-requests"/>
</requires>
<extension point="xbmc.metadata.scraper.tvshows" library="main.py" cachepersistence="24:00"/>
<extension point="xbmc.addon.metadata">
Expand All @@ -20,7 +21,7 @@ We provide an API that can be used by anyone or service like Kodi to retrieve TV
</assets>
<website>https://www.tvmaze.com</website>
<source>https://github.com/romanvm/kodi.tvmaze</source>
<news>1.3.4: Fix incompatibility with filename tags in Kodi "Omega".
<news>1.3.6: Internal changes.
</news>
<reuselanguageinvoker>true</reuselanguageinvoker>
</extension>
Expand Down
10 changes: 8 additions & 2 deletions metadata.tvmaze/libs/imdb_rating.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@
import re
from typing import Dict, Union, Optional

from . import simple_requests as requests
import simple_requests as requests

IMDB_TITLE_URL = 'https://www.imdb.com/title/{}/'

HEADERS = (
('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 '
'(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'),
('Accept', 'text/html'),
)


def get_imdb_rating(imdb_id: str) -> Optional[Dict[str, Union[int, float]]]:
url = IMDB_TITLE_URL.format(imdb_id)
response = requests.get(url)
response = requests.get(url, headers=dict(HEADERS))
if response.ok:
ld_json_match = re.search(r'<script type="application/ld\+json">([^<]+?)</script>',
response.text)
Expand Down
235 changes: 0 additions & 235 deletions metadata.tvmaze/libs/simple_requests.py

This file was deleted.

3 changes: 2 additions & 1 deletion metadata.tvmaze/libs/tvmaze_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from pprint import pformat
from typing import Text, Optional, Union, List, Dict, Any

import simple_requests as requests

from . import cache_service as cache
from . import simple_requests as requests
from .imdb_rating import get_imdb_rating

InfoType = Dict[str, Any] # pylint: disable=invalid-name
Expand Down
Loading