Skip to main content

Newgrounds flash game scraper powered by bs4 and requests

Project description

NGScrape

Newgrounds game scraper made with beautifulsoup4 and requestslib.

NGScrape is licensed under the GNU Affero General Public License v3.0. If a copy is not included with this file, you can find one at https://www.gnu.org/licenses/agpl-3.0.en.html.

Please star is this was useful!

Functions:

  • __init__(debug: bool = False) -> None
    • Start a new NGScrape Instance.
    • Parameters:
      • debug (bool) = False: Enable/Disable debug mode
      • cache (bool) = False: Enable/Disable caching
  • scrape_game(url: str, download: str, filename: str) -> None
    • Scrape a flash game by url.
    • Parameters:
      • url (str): The URL of the flash game. For example, the URL for Alien Homonid is https://www.newgrounds.com/portal/view/59593.
      • download (str): The directory to download the file to.
      • filename (str): The name of the downloaded file.
    • Example parameters:
      • url = 'https://www.newgrounds.com/portal/view/59593'
      • download = 'testdir'
      • filename = 'game.swf'
    • Example output with debug mode:
      • NGScrape: Made request to https://www.newgrounds.com/portal/view/59593 and got status code 200
      • NGScrape: Found flash game link https:\/\/uploads.ungrounded.net\/59000\/59593_alien_booya.swf?f1101313499
      • NGScrape: Downloaded swf file to testdir/game.swf
  • scrape_desc(self, url: str) -> str
    • Scrape a flash game's description by url. Returns the description of the game.
    • Parameters:
      • url (str): The URL of the flash game. For example, the URL for Alien Homonid is https://www.newgrounds.com/portal/view/59593.
    • Example parameters:
      • url = 'https://www.newgrounds.com/portal/view/59593'
    • Example output with debug mode:
      • NGScrape: Made request to https://www.newgrounds.com/portal/view/59593 and got status code 200
      • NGScrape: Found game description "Blast FBI agents in this Metal Slug style shooter!"
  • scrape_card(self, url: str, download: str, filename: str) -> str
    • Scrape a flash game's card by url. The file extention will be automatically determined. Returns the name of the card file.
    • Parameters:
      • url (str): The URL of the flash game. For example, the URL for Alien Homonid is https://www.newgrounds.com/portal/view/59593.
      • download (str): The directory to download the file to.
      • filename (str): The name of the downloaded file. The file extention will be automatically determined.
    • Example parameters:
      • url = 'https://www.newgrounds.com/portal/view/59593'
      • download = 'testdir'
      • filename = 'card'
    • Example output with debug mode:
      • NGScrape: Made request to https://www.newgrounds.com/portal/view/59593 and got status code 200
      • NGScrape: Found card link https://picon.ngfiles.com/59000/flash_59593_card.png?f1607717241
      • NGScrape: Downloaded png file to testdir/card.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ngscrape-2.0.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

ngscrape-2.0.0-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file ngscrape-2.0.0.tar.gz.

File metadata

  • Download URL: ngscrape-2.0.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ngscrape-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cd6a69e39d2562673033623a43fc9a5320a519d0c18b4eaa7f5a628fb5464154
MD5 193d358437ac38df50cd706a7a1f8978
BLAKE2b-256 3eed8b07c83352985bb9e606ab6230aa58e67b5d5bf990c928d2eacb3ab5d044

See more details on using hashes here.

File details

Details for the file ngscrape-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ngscrape-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for ngscrape-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95de2251423540a844fba4074419cd45ef585ee289c0af92e537b3426ba6b98d
MD5 90f58155576de54b813758ea00667ebe
BLAKE2b-256 10501528f8136fbbeb5a857f35f8c8ec4e1404e7a00ef6969c6102b3bb4276ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page