mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
add provisional generic extractor
This commit is contained in:
parent
e7512f626d
commit
65c8566326
@ -46,6 +46,7 @@ modules = [
|
||||
"spectrumnexus",
|
||||
"turboimagehost",
|
||||
"yandere",
|
||||
"generic",
|
||||
]
|
||||
|
||||
def find(url):
|
||||
|
27
gallery_dl/extractor/generic.py
Normal file
27
gallery_dl/extractor/generic.py
Normal file
@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2015 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
"""Generic extractor"""
|
||||
|
||||
import re
|
||||
from .common import Extractor, Message
|
||||
|
||||
class GenericExtractor(Extractor):
|
||||
|
||||
category = "generic"
|
||||
pattern = ["generic:(.+)"]
|
||||
|
||||
def __init__(self, match):
|
||||
Extractor.__init__(self)
|
||||
self.url = match.group(1)
|
||||
|
||||
def items(self):
|
||||
page = self.request(self.url).text
|
||||
yield Message.Version, 1
|
||||
for match in re.finditer("https?://[^ \"']+", page):
|
||||
yield Message.Queue, match.group(0)
|
Loading…
Reference in New Issue
Block a user