You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scraper = EmbyScraper(base_url="insert your emby url", api_key="insert your emby api")
def sources(item):
if item['type'] == 'movie':
results = scraper.get_movie(item['title'], item.get('year'))
elif item['type'] == 'episode':
show_results = scraper.get_tvshow(item['show_title'])
for show_result in show_results:
season_results = scraper.get_season(show_result['Id'])
for season_result in season_results:
if season_result['IndexNumber'] == item['season_number']:
results = scraper.get_episode(season_result['Id'])
break
else:
results = []
sources = []
for result in results:
if item['type'] == 'episode' and result['IndexNumber'] != item['episode_number']:
continue
source = {
'url': result['Path'],
'quality': 'HD', # Adjust this based on your own criteria
'language': 'en', # Adjust this based on your own criteria
'provider': 'Emby', # Adjust this as needed
}
sources.append(source)
return sources
def search(item):
return sources(item)
`
The text was updated successfully, but these errors were encountered:
`import requests
import logging
class EmbyScraper:
def init(self, base_url, api_key):
self.base_url = base_url
self.api_key = api_key
self.session = requests.Session()
self.session.headers.update({"X-MediaBrowser-Token": self.api_key})
Initialize EmbyScraper
scraper = EmbyScraper(base_url="insert your emby url", api_key="insert your emby api")
def sources(item):
if item['type'] == 'movie':
results = scraper.get_movie(item['title'], item.get('year'))
elif item['type'] == 'episode':
show_results = scraper.get_tvshow(item['show_title'])
for show_result in show_results:
season_results = scraper.get_season(show_result['Id'])
for season_result in season_results:
if season_result['IndexNumber'] == item['season_number']:
results = scraper.get_episode(season_result['Id'])
break
else:
results = []
def search(item):
return sources(item)
`
The text was updated successfully, but these errors were encountered: