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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ngscrape-1.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 1427a9847fbc47c8d2b166a0097bb69403d181361a408a8909f29842fcda9638
MD5 561e96408badaa8450a61294e8c5458b
BLAKE2b-256 0ca64b27193cd868bce58383c6f191719329ea515186d455cb33e61f7d2ca1e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ngscrape-1.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9731ede86ea51c8f21421fe8bbec299e74575e0b0824722e1f801df0a94ad835
MD5 47794562a1b35a2d9ddd7bed5ed1fc39
BLAKE2b-256 e7ce5f15397f44c1dc26fcfbe3f09340e5e0e394f32ef5133039338187d83e7e

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