From 3df0d6d71577f90f0fbbcad16bd41bc4b952bd13 Mon Sep 17 00:00:00 2001 From: Techwolf Date: Sat, 3 Aug 2019 00:52:24 -0700 Subject: [PATCH] Add MyLifeWithFel --- dosagelib/plugins/m.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dosagelib/plugins/m.py b/dosagelib/plugins/m.py index 79501c63d..a16ac8fcc 100755 --- a/dosagelib/plugins/m.py +++ b/dosagelib/plugins/m.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function +import json from re import compile, escape, IGNORECASE from ..helpers import indirectStarter, xpath_class @@ -235,6 +236,29 @@ class MyCartoons(_BasicScraper): lang = 'de' +class MyLifeWithFel(_ParserScraper): + baseUrl = 'https://www.mylifewithfel.com/' + stripUrl = baseUrl + 'api/posts/%s' + firstStripUrl = stripUrl % '1' + url = firstStripUrl + adult = True + + def starter(self): + # Retrieve comic metadata from API + data = self.session.get(self.url) + data.raise_for_status() + return self.stripUrl % data.json()['last']['id'] + + def getPrevUrl(self, url, data): + return self.stripUrl % json.loads(data.text_content())['previous']['id'] + + def fetchUrls(self, url, data, urlSearch): + return [self.baseUrl + json.loads(data.text_content())['post']['image']] + + def namer(self, imageUrl, pageUrl): + return pageUrl.rsplit('/', 1)[-1] + + class MynarskiForest(_ParserScraper): stripUrl = 'http://mynarskiforest.purrsia.com/xsl%s.htm' url = stripUrl % '09_36'