[poringa] improvements and fixes

- add 'num' and 'count' metadata fields
- prevent crash for "private" posts
- prevent crash when there's no 'main-info'
- update tests
This commit is contained in:
Mike Fährmann
2023-12-30 20:37:09 +01:00
parent e348da7a06
commit 9f21c839ad
2 changed files with 45 additions and 29 deletions

View File

@@ -12,36 +12,43 @@ __tests__ = (
"#url" : "http://www.poringa.net/posts/imagenes/3051081/Turrita-alto-ojete.html",
"#category": ("", "poringa", "post"),
"#class" : poringa.PoringaPostExtractor,
"#pattern" : r"http://www\.poringa\.net/posts/imagenes/3051081/[a-zA-Z0-9_-]+\.html",
"#count" : 26,
"post_id" : "3051081",
"title" : "turrita alto ojete...",
"user" : "vipower1top",
"count" : 26,
"num" : range(1, 26),
"post_id" : "3051081",
"title" : "turrita alto ojete...",
"user" : "vipower1top",
},
{
"#url" : "http://www.poringa.net/posts/imagenes/3095554/Otra-culona-de-instagram.html",
"#category": ("", "poringa", "post"),
"#class" : poringa.PoringaPostExtractor,
"#pattern" : r"http://www\.poringa\.net/posts/imagenes/3095554/[a-zA-Z0-9_-]+\.html",
"#count" : 15,
"post_id" : "3095554",
"title" : "Otra culona de instagram",
"user" : "Expectro007",
"count" : 15,
"num" : range(1, 15),
"post_id" : "3095554",
"title" : "Otra culona de instagram",
"user" : "Expectro007",
},
{
"#url" : "http://www.poringa.net/Expectro007",
"#category": ("", "poringa", "user"),
"#class" : poringa.PoringaUserExtractor,
"#pattern" : r"https?://img-[0-9]\.poringa\.net/poringa/img/[a-zA-Z0-9/{2}]{12}[a-zA-Z0-9-_]+/[a-zA-Z0-9-_]+\.jpg",
"#pattern" : r"https?://img-\d+\.poringa\.net/poringa/img/././././././Expectro007/\w{3}\.(jpg|png|gif)",
"#count" : range(500, 600),
},
{
"#url" : "http://www.poringa.net/buscar/?&q=yuslopez",
"#category": ("", "poringa", "search"),
"#class" : poringa.PoringaSearchExtractor,
"#pattern" : r"https?://img-[0-9]\.poringa\.net/poringa/img/[a-zA-Z0-9/{2}]{12}[a-zA-Z0-9-_]+/[a-zA-Z0-9-_]+\.jpg",
"#pattern" : r"https?://img-\d+\.poringa\.net/poringa/img/././././././\w+/\w{3}\.(jpg|png|gif)",
"#range" : "1-50",
"#count" : 50,
},
)