Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asian Sex Diary Support #131

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions scenes/siteEuroSexDiary.py → scenes/networkGlobeTwatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
from tpdb.BaseSceneScraper import BaseSceneScraper


class SiteEuroSexDiarySpider(BaseSceneScraper):
name = 'EuroSexDiary'
network = 'Euro Sex Diary'
parent = 'Euro Sex Diary'
site = 'Euro Sex Diary'
class networkGlobeTwatters(BaseSceneScraper):
name = 'GlobeTwatter'
network = 'Globe Twatters'
parent = 'Globe Twatters'

start_urls = [
'https://asiansexdiary.com',
'https://eurosexdiary.com',
'https://trikepatrol.com',
'https://tuktukpatrol.com',
'https://milftrip.com',
'https://helloladyboy.com',
]

selector_map = {
Expand All @@ -24,16 +28,34 @@
'tags': '//div[@class="amp-category"]/span/a/text()',
'external_id': r'.*/(.*?)/$',
'trailer': '//div[contains(@class, "video-player")]/amp-video/@src',
'pagination': '/category/conquests/page/%s/'
'pagination': ['/category/conquests/page/%s/','/all-updates/page/%s/'],

Check failure on line 31 in scenes/networkGlobeTwatters.py

View workflow job for this annotation

GitHub Actions / Lint

[flake8] reported by reviewdog 🐶 missing whitespace after ',' Raw Output: ./scenes/networkGlobeTwatters.py:31:54: E231 missing whitespace after ','
'duration': '//i[contains(@class,"fa") and contains(@class,"fa-video-camera")]/ancestor::div[1]/text()',
}

pattern = re.compile(r'\b[\w\s?]*\s?\b')

def get_scenes(self, response):
scenes = response.xpath('//article/a/@href').getall()

meta = response.meta
site = response.xpath('//div[contains(@class,"amp-logo-footer")]//a/@title').get()
site = re.match(r'\b[\w\s?]*\s?\b', site).group(0).strip()
meta['site'] = site

for scene in scenes:
if re.search(self.get_selector_map('external_id'), scene):
yield scrapy.Request(url=self.format_link(response, scene), callback=self.parse_scene)
yield scrapy.Request(url=self.format_link(response, scene), callback=self.parse_scene, meta=meta)

def get_description(self, response):
description = super().get_description(response)
description = re.sub('<[^<]+?>', '', description).strip()
return description

Check warning on line 53 in scenes/networkGlobeTwatters.py

View workflow job for this annotation

GitHub Actions / Lint

[flake8] reported by reviewdog 🐶 blank line contains whitespace Raw Output: ./scenes/networkGlobeTwatters.py:53:1: W293 blank line contains whitespace
def get_site(self, response):
return response.meta['site']

Check warning on line 56 in scenes/networkGlobeTwatters.py

View workflow job for this annotation

GitHub Actions / Lint

[flake8] reported by reviewdog 🐶 blank line contains whitespace Raw Output: ./scenes/networkGlobeTwatters.py:56:1: W293 blank line contains whitespace
def get_next_page_url(self, base, page):
if "diary" in base:
return self.format_url(base, self.get_selector_map('pagination')[0] % page)
else:
return self.format_url(base, self.get_selector_map('pagination')[1] % page)
Loading