Skip to content

Commit 3cb3b49

Browse files
committed
Always prefer studio over distributor when scraping IAFD
1 parent f33f57f commit 3cb3b49

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scrapers/IAFD/IAFD.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
SHARED_SELECTORS = {
4848
"title": "//h1/text()",
4949
"director": '//p[@class="bioheading"][contains(text(),"Director") or contains(text(),"Directors")]/following-sibling::p[@class="biodata"][1]/a/text()',
50-
"studio": '//p[@class="bioheading"][contains(text(),"Studio") or contains(text(),"Distributor")]/following-sibling::p[@class="biodata"][1]//text()',
50+
"studio": '//p[@class="bioheading"][contains(text(),"Studio")]/following-sibling::p[@class="biodata"][1]//text()',
51+
"distributor": '//p[@class="bioheading"][contains(text(),"Distributor")]/following-sibling::p[@class="biodata"][1]//text()',
5152
"date": '//p[@class="bioheading"][contains(text(), "Release Date")]/following-sibling::p[@class="biodata"][1]/text()',
5253
"synopsis": '//div[@id="synopsis"]/div[@class="padded-panel"]//text()',
5354
}
@@ -269,6 +270,9 @@ def scene_studio(tree):
269270
return maybe(
270271
tree.xpath(SHARED_SELECTORS["studio"]),
271272
lambda s: {"name": s},
273+
) or maybe(
274+
tree.xpath(SHARED_SELECTORS["distributor"]),
275+
lambda s: {"name": s},
272276
)
273277

274278

@@ -301,6 +305,9 @@ def movie_studio(tree):
301305
return maybe(
302306
tree.xpath(SHARED_SELECTORS["studio"]),
303307
lambda s: {"name": s},
308+
) or maybe(
309+
tree.xpath(SHARED_SELECTORS["distributor"]),
310+
lambda s: {"name": s},
304311
)
305312

306313

0 commit comments

Comments
 (0)