Get wattpad stories and chapters, and download them as ebook
Project description
Extraia histórias do Wattpad com facilidade! Com este pacote, você pode buscar histórias, baixá-las diretamente e até convertê-las para formatos de eBook como EPUB e PDF (em desenvolvimento).
Importante: Este é um código baseado em no código oficial do Ayobamidele, pois como não havia uma biblioteca hospedada, eu resolvi hospedar.
Funcionalidades Principais
- Pesquisar histórias no Wattpad.
- Baixar histórias utilizando a URL.
- Converter histórias para o formato EPUB.
- Login para acessar conteúdos exclusivos.
Links Importantes
Instalação
Para instalar o pacote, basta usar o comando abaixo no terminal:
pip install jb-wattpad-scraper
Como Usar
Baixar História por URL
from wattpad_scraper import Wattpad
wattpad = Wattpad()
url_historia = "https://www.wattpad.com/story/162756571-bending-the-rules-the-rules-1"
historia = wattpad.get_book_by_url(url_historia)
print(historia.title) # TÃtulo da história
print(historia.author.name, historia.author.url) # Autor e link do perfil
print(historia.description) # Descrição
print(historia.chapters[0].title, historia.chapters[0].content) # Primeiro capÃtulo e conteúdo
Pesquisar Histórias
from wattpad_scraper import Wattpad
wattpad = Wattpad()
resultados = wattpad.search_books('romance histórico', completed=True, mature=True, free=True, paid=False, limit=5)
for historia in resultados:
print(historia.title) # Exibe os tÃtulos encontrados
Converter História para EPUB
from wattpad_scraper import Wattpad
wattpad = Wattpad()
historia = wattpad.search_books('fantasia mágica')[0]
historia.convert_to_epub() # Converte e salva no diretório atual
Autenticação (Beta)
from wattpad_scraper import Wattpad
wattpad = Wattpad("seu_usuario", "sua_senha")
historia = wattpad.search_books("aventura épica")[0]
print(historia.chapters[2].content) # Conteúdo do terceiro capÃtulo
Usando Arquivo de Cookies
- Instale a extensão "Cookie - Editor" no navegador.
- Exporte os cookies e salve como um arquivo
.json. - Utilize no código conforme o exemplo abaixo:
from wattpad_scraper import Wattpad
wattpad = Wattpad(cookie_file='/caminho/para/cookies.json')
resultados = wattpad.search_books("histórias exclusivas")
Contribua
Contribuições são sempre bem-vindas! Sinta-se à vontade para abrir issues ou enviar pull requests.
Desenvolvido com 💖 para todos os fãs de leitura.
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 jb_wattpad_scraper-0.0.40.tar.gz.
File metadata
- Download URL: jb_wattpad_scraper-0.0.40.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deedd2af8464f51630298eb11d024d3cce28061c8de9ff968744eb0b4cad5faa
|
|
| MD5 |
4a5227be6891d61cf143cfba931d3d52
|
|
| BLAKE2b-256 |
6f47383468d46494f83278f55fee723a9bf9c67e4b9cd9bd43efda108f8ae7b1
|
File details
Details for the file jb_wattpad_scraper-0.0.40-py3-none-any.whl.
File metadata
- Download URL: jb_wattpad_scraper-0.0.40-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f59bad846eb1b10583074aed30ffa24267d5010d4e1123174b84ea259a2ff20
|
|
| MD5 |
b4669fb1709cf93649d038e14061a7dc
|
|
| BLAKE2b-256 |
5580e13b61e47b8ba672355ff4694ec9393f21675bc028fd8c78329e6bbd68b8
|