Skip to main content

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

  1. Instale a extensão "Cookie - Editor" no navegador.
  2. Exporte os cookies e salve como um arquivo .json.
  3. 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


Download files

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

Source Distribution

jb_wattpad_scraper-0.0.40.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jb_wattpad_scraper-0.0.40-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

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

Hashes for jb_wattpad_scraper-0.0.40.tar.gz
Algorithm Hash digest
SHA256 deedd2af8464f51630298eb11d024d3cce28061c8de9ff968744eb0b4cad5faa
MD5 4a5227be6891d61cf143cfba931d3d52
BLAKE2b-256 6f47383468d46494f83278f55fee723a9bf9c67e4b9cd9bd43efda108f8ae7b1

See more details on using hashes here.

File details

Details for the file jb_wattpad_scraper-0.0.40-py3-none-any.whl.

File metadata

File hashes

Hashes for jb_wattpad_scraper-0.0.40-py3-none-any.whl
Algorithm Hash digest
SHA256 0f59bad846eb1b10583074aed30ffa24267d5010d4e1123174b84ea259a2ff20
MD5 b4669fb1709cf93649d038e14061a7dc
BLAKE2b-256 5580e13b61e47b8ba672355ff4694ec9393f21675bc028fd8c78329e6bbd68b8

See more details on using hashes here.

Supported by

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