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__(self, debug: bool = False, cache: bool = False, parser: str = 'html.parser') -> None- Start a new NGScrape Instance.
- Parameters:
- debug (bool) = False: Enable/Disable debug mode
- cache (bool) = False: Enable/Disable caching
- parser (str) = 'lxml': Parser used by BS4
- Parameters:
- Start a new NGScrape Instance.
scrape_game(url: str, download: str, filename: str) -> None- Scrape a flash game by url. Returns the URL for the swf.
- Parameters:
- url (str): The URL of the flash game. For example, the URL for Alien Homonid is
https://www.newgrounds.com/portal/view/59593.
- url (str): The URL of the flash game. For example, the URL for Alien Homonid is
- 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/59593and got status code200 - NGScrape: Found flash game link
https:\/\/uploads.ungrounded.net\/59000\/59593_alien_booya.swf?f1101313499
- NGScrape: Made request to
- Parameters:
- Scrape a flash game by url. Returns the URL for the 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.
- url (str): The URL of the flash game. For example, the URL for Alien Homonid is
- 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/59593and got status code200 - NGScrape: Found game description "Blast FBI agents in this Metal Slug style shooter!"
- NGScrape: Made request to
- Parameters:
- Scrape a flash game's description by url. Returns the description of the game.
scrape_card(self, url: str) -> str- Scrape a flash game's card by url. Returns the URL 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.
- url (str): The URL of the flash game. For example, the URL for Alien Homonid is
- 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/59593and got status code200 - NGScrape: Found card link
https://picon.ngfiles.com/59000/flash_59593_card.png?f1607717241
- NGScrape: Made request to
- Parameters:
- Scrape a flash game's card by url. Returns the URL of the card file.
scrape_title(self, url: str) -> str- Scrape a flash game's title with url. Returns title of the flash 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.
- url (str): The URL of the flash game. For example, the URL for Alien Homonid is
- 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/59593and got status code200 - NGScrape: Found game title "Alien Homonid"
- NGScrape: Made request to
- Parameters:
- Scrape a flash game's title with url. Returns title of the flash game.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ngscrape-3.0.3.tar.gz.
File metadata
- Download URL: ngscrape-3.0.3.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22770a8830b72e2fdff071463a6e15f0f10feb7e26e73b1376225faef6dd0fb2
|
|
| MD5 |
aa8cc913edd09b6e72e24dfccac2e96c
|
|
| BLAKE2b-256 |
a9e4071d890c4437aa55dd4f01711e88e0b6a0e69c60fb2bbf57e5100dfc24a4
|
File details
Details for the file ngscrape-3.0.3-py3-none-any.whl.
File metadata
- Download URL: ngscrape-3.0.3-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79291a3956de037d6db378aba403f09b9ff989a9e456947e5d5f9d4000743980
|
|
| MD5 |
ba705aa4689efacd832fc9ba148a30d1
|
|
| BLAKE2b-256 |
26ec4eae12656a70aa9e40d8190d010c16872928f2376ba59c1741c03a134102
|