akynazh / jvav

Useful tools for crawling study resources.
https://pypi.org/project/Jvav
GNU General Public License v3.0
40 stars 8 forks source link

JavBusUtil some improvement suggestion. #7

Closed peppy0510 closed 1 month ago

peppy0510 commented 2 months ago

Appreciate a lot for your repository !!!

akynazh commented 2 months ago

Appreciate a lot for your repository !!!

  • JavBusUtil initial argument

    • bus_auth should have default empty string value ""

    • line 1191 bus_auth: str,

    • to bus_auth="",

  • JavBusUtil other languages support

    • in case of base_url = "https://www.javbus.com/en" to retrieve stars name with English or another language rather than Japanese.

    • get_av_by_id() should not remove and rejoin empty spaces when parse a tags.

    • line 1563 av["tags"] = ["".join(tag.text.split()) for tag in tags]

    • to av["tags"] = [tag.text.strip() for tag in tags]

    • or av["tags"] = [re.sub(r"[\s]+", " ", tag.text.strip()) for tag in tags] to remove double spaces

    • or av["tags"] = [re.sub(r"([^a-z]|^)[\s]+([^a-z]|$)", r"\1\2", tag.text.strip(), flags=re.IGNORECASE) for tag in tags] to remove space only between non English characters

Thanks! Can you make a pull request?