Commit e229ce4c authored by TheTechRobo's avatar TheTechRobo
Browse files

Merge branch 'rebane2001-hobune-comments'

parents aca189d0 2a797d42
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -466,6 +466,8 @@ class Hobune(Service):
        lastupdated = time.time()
        cls.lastretrieved = lastupdated

        comments = False

        for url in urls_to_try:
            url = url.format(id)
            async with session.head(url, timeout=5) as resp:
@@ -478,12 +480,22 @@ class Hobune(Service):
                    contains = LinkContains(video = True, metadata = True, thumbnail = True),
                    title = "Video"
                )

                comments_url = url.replace("/videos/", "/comments/")
                async with session.head(comments_url, timeout=5) as comments_resp:
                    if comments_resp.status == 200:
                        comments = True
                        yield Link(
                            url = comments_url,
                            contains = LinkContains(comments = True),
                            title = "Comments"
                        )
            elif code != 404:
                raise RuntimeError("Hobune.stream returned invalid status code %s" % code)

        yield cls(
            archived=archived, lastupdated=lastupdated, name=cls.getName(), note="",
            rawraw=raw, metaonly=False, classname=cls.__name__
            archived=archived, comments=comments, lastupdated=lastupdated, name=cls.getName(),
            note="", rawraw=raw, metaonly=False, classname=cls.__name__
        )

class removededm(Service):