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_by_url(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_by_url(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_by_url(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-1.3.2.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ngscrape-1.3.2.tar.gz
Algorithm Hash digest
SHA256 abb036a1ff3523caf08b93d5c78efb2b6395a3394818b10048c4befa8b24ba8f
MD5 c4b6daa2b00b1987b9a7aaa4f613107d
BLAKE2b-256 c7bce92494df26cd5ecf9807c65269a4d82921123682ef1a1887019726b689d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ngscrape-1.3.2-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.0

File hashes

Hashes for ngscrape-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0cdeb54b483558fcde813e3b9c1fab9171bd0a40b30b69998ea67abc3c66d62
MD5 deebe0d305a1f4797f77c23f7f27e1fb
BLAKE2b-256 ff8904849e40141cbf108d77123cf24bdb176f9167fac9d0fbffa3aefe09b8cb

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