Loading REQUIREMENTS.txt +2 −1 Original line number Diff line number Diff line Loading @@ -7,3 +7,4 @@ cachetools click asyncache pyyaml innertube No newline at end of file config.template.yml +4 −0 Original line number Diff line number Diff line version: 3 methods: youtubei: title: YouTube enabled: true ia_wayback: title: Wayback Machine enabled: true Loading lostmediafinder/finder.py +33 −1 Original line number Diff line number Diff line Loading @@ -2,10 +2,42 @@ All the Service implementations live here. """ import random, time, urllib.parse, aiohttp, asyncio import random, time, urllib.parse, aiohttp, asyncio, requests, json, innertube from switch import Switch from .types import YouTubeService, T, methods youtubei = innertube.InnerTube("WEB") class YouTubeI(YouTubeService): """ Queries innertube to see if the video is still available on YouTube. """ name = methods["youtubei"]["title"] configId = "youtubei" @classmethod async def _run(cls, id, session: aiohttp.ClientSession, includeRaw=True) -> T: data = youtubei.player(id) code = 200 rawraw = code if includeRaw else None archived = None link = f"https://youtu.be/{id}" if "playabilityStatus" in data and data["playabilityStatus"]["status"] == "OK": print(data["playabilityStatus"]["status"]) archived = True else: archived = False capcount = int(archived) available = link if archived else None lastupdated = time.time() return cls( archived=archived, available=available, capcount=capcount, lastupdated=lastupdated, name=cls.getName(), note="", rawraw=rawraw, metaonly=False, comments=False ) class WaybackMachine(YouTubeService): """ Queries the Wayback Machine for the video you requested. Loading static/script.js +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ function finish(vid1) { } else { colour = "red"; } var isarchived = wbm.archived ? "Archived" : "Not Archived"; var isarchived = wbm.archived ? "Available" : "Not Available"; if (wbm.error !== null) { isarchived = "Unknown"; wbm.note = wbm.note + wbm.error; Loading Loading
REQUIREMENTS.txt +2 −1 Original line number Diff line number Diff line Loading @@ -7,3 +7,4 @@ cachetools click asyncache pyyaml innertube No newline at end of file
config.template.yml +4 −0 Original line number Diff line number Diff line version: 3 methods: youtubei: title: YouTube enabled: true ia_wayback: title: Wayback Machine enabled: true Loading
lostmediafinder/finder.py +33 −1 Original line number Diff line number Diff line Loading @@ -2,10 +2,42 @@ All the Service implementations live here. """ import random, time, urllib.parse, aiohttp, asyncio import random, time, urllib.parse, aiohttp, asyncio, requests, json, innertube from switch import Switch from .types import YouTubeService, T, methods youtubei = innertube.InnerTube("WEB") class YouTubeI(YouTubeService): """ Queries innertube to see if the video is still available on YouTube. """ name = methods["youtubei"]["title"] configId = "youtubei" @classmethod async def _run(cls, id, session: aiohttp.ClientSession, includeRaw=True) -> T: data = youtubei.player(id) code = 200 rawraw = code if includeRaw else None archived = None link = f"https://youtu.be/{id}" if "playabilityStatus" in data and data["playabilityStatus"]["status"] == "OK": print(data["playabilityStatus"]["status"]) archived = True else: archived = False capcount = int(archived) available = link if archived else None lastupdated = time.time() return cls( archived=archived, available=available, capcount=capcount, lastupdated=lastupdated, name=cls.getName(), note="", rawraw=rawraw, metaonly=False, comments=False ) class WaybackMachine(YouTubeService): """ Queries the Wayback Machine for the video you requested. Loading
static/script.js +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ function finish(vid1) { } else { colour = "red"; } var isarchived = wbm.archived ? "Archived" : "Not Archived"; var isarchived = wbm.archived ? "Available" : "Not Available"; if (wbm.error !== null) { isarchived = "Unknown"; wbm.note = wbm.note + wbm.error; Loading