GithubHelp home page GithubHelp logo

tomojl / frieren-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xct007/frieren-scraper

0.0 0.0 0.0 128 KB

Scraping challenge for me.

License: MIT License

JavaScript 4.28% TypeScript 95.72%

frieren-scraper's Introduction

Challenge

  • Scrape only using
    • Axios
    • Cheerio

and results must be JSON Object.

Target

You decide, you can open issues what website/app and data to be scrapped.

Progress.

  • Anime/comic
    • Doujindesu
      • latest
      • search
      • detail
    • Otakudesu
      • latest
      • search
      • detail
    • Anoboy
      • latest
      • search
      • detail
    • Komiku.id
      • latest
      • search
      • detail
    • Hentai.tv
      • etc.
  • Downloader?
    • Youtube
      • search
        • videos
      • dowload
    • Status Video Wa Indonesia
      • popular
      • search
    • Instagram
    • Tiktok
    • Facebook
    • ZippyShare. reference
      • download
    • Pinterest
  • Searching
    • Unsplash
      • search
    • Danbooru
      • search
    • Music
      • search
    • Apkmody
      • search
      • detail
  • Maker
    • PhotoFunia
      • text
        • 1 param.
        • 2 param
      • image
        • Buffer
    • Image Diffusion.
      • stable ( restAPIs )
      • anime ( restAPIs )
  • Nsfw
    • Bokepsin
      • latest
      • search
      • detail

Usage

Install packages.

Using GitHub version to test latest fix/update.

npm install github:xct007/frieren-scraper

Notice.

Package name changed to @xct007/frieren-scraper

Example use

Social Media.

Youtube

import { youtube } from "@xct007/frieren-scraper";

// searching videos
const ArrObj = await youtube.search("rose gone mv");
console.log(ArrObj);

// fetch download url;
const Obj = await youtube.download("https://www.youtube.com/watch?v=xxx");
console.log(Obj);

Tiktok

import { tiktok } from "@xct007/frieren-scraper";

// v1. fetch detail/download url
const Obj = await tiktok.v1("https://TIKTOK_URL");
console.log(Obj);

// others version will added soon.

Instagram

import { instagram } from "@xct007/frieren-scraper";

// v1. fetch direct download url
const Obj = await instagram.v1("https://instagram_URL");
console.log(Obj);

// others version will added soon.

Facebook.

import { facebook } from "@xct007/frieren-scraper";

// v1. fetch direct download url
const Obj = await facebook.v1("https://FACEBOOK_URL");
console.log(Obj);

// others version will added soon.

Story WhatsApp Videos.

import { storyWa } from "@xct007/frieren-scraper";

// fetch popular videos
const ArrObj = await storyWa.popular();
console.log(ArrObj);

// search videos by query
const ArrObj = await storyWa.search("query");
console.log(ArrObj);

ZippyShare. (Not working)

import { zippyshare } from "@xct007/frieren-scraper";

// fetch direct download url
const Obj = await zippyshare.download("https://ZIPPYSHARE_URL");
console.log(Obj);

Pinterest.

import { pinterest } from "@xct007/frieren-scraper";

// v1. fetch direct download url
const Obj = await pinterest.v1("https://PINTEREST_URL");
console.log(Obj);

// others version will added soon.

Anime/comic.

Komiku.id.

import { komikuId } from "@xct007/frieren-scraper";

// fetch latest comic
const ArrObj = await komikuId.latest();
console.log(ArrObj);

// search comic by query
const ArrObj = await komikuId.search("query");
console.log(ArrObj);

// fetch comic/chapter detail by url.
const Obj = await komikuId.detail("https://KOMIKUID_URL");
console.log(Obj);

Otakudesu.

import { otakudesu } from "@xct007/frieren-scraper";

// fetch latest anime
const ArrObj = await otakudesu.latest();
console.log(ArrObj);

// search anime by query
const ArrObj = await otakudesu.search("query");
console.log(ArrObj);

// fetch anime detail by url
const Obj = await otakudesu.detail("https://OTAKUDESU_URL");
console.log(Obj);

Anoboy.

import { anoboy } from "@xct007/frieren-scraper";

// fetch latest anime
const ArrObj = await anoboy.latest();
console.log(ArrObj);

// search anime by query
const ArrObj = await anoboy.search("query");
console.log(ArrObj);

// fetch anime detail by url
const Obj = await anoboy.search("https://ANOBOY_URL");
console.log(Obj);

Doujindesu.

import { doujindesu } from "@xct007/frieren-scraper";

// fetch latest doujin
const ArrObj = await doujindesu.latest();
console.log(ArrObj);

// search doujin by query
const ArrObj = await doujindesu.search("query");
console.log(ArrObj);

// fetch doujin detail by url
const Obj = await doujindesu.detail("https://DOUJINDESU_URL");
console.log(Obj);

Searching?

Unsplash.

import { unsplash } from "@xct007/frieren-scraper";

// Search images by query
const ArrObj = await unsplash.search("query");
console.log(ArrObj);

Danbooru.

import { danbooru } from "@xct007/frieren-scraper";

// Search images by query
const ArrObj = await danbooru.search("query");
console.log(ArrObj);

Music.

import { music } from "@xct007/frieren-scraper";

// Search music and audio url by query.
// more short query, more results found.
const ArrObj = await music.search("query");
console.log(ArrObj);

Apkmody.

import { apkmody } from "@xct007/frieren-scraper";

// search apps/games
const ArrObj = await apkmody.search("query");
console.log(ArrObj);

// fetch direct download url
// High memory usage. LOL
const Obj = await apkmody.download("https://APKMODY_URL");
console.log(Obj);

Maker.

PhotoFunia.

import { photofunia } from "@xct007/frieren-scraper";

// get list all effects key.
const ArrObj = await photofunia.listEffects();
console.log(ArrObj);

// Generate text on image by key
const key = "balloon".
const Obj = await photofunia.create(key, {
  type: "text", // pass type as text.
  input: "Text should generate"
});
console.log(Obj);

// Image filter
const key = "the-frame".
const Obj = await photofunia.create(key, {
  type: "image", // pass type as image.
  // input only accept Buffer
  input: fs.readFileSync("./path_image.jpg") // LOL af
});
console.log(Obj);

Image Diffusion.

import { diffusion } from "@xct007/frieren-scraper";
import { writeFileSync } from "fs";

// stable diffusion.
const prompt = "1girl, blush, looking to viewer, warm smile,";
const seed = 123456789; // (optional). default random.

const Obj = await diffusion.stable(prompt, seed);
console.log(Obj);
/*
  {
    process_time: Number,
    seed: "String",
    ext: "String",
    mimetype: "String",
    base64Img: "String" // encodedBase64
  }
*/

// example save to disk
const saveFilename = `./image.${Obj.ext}`;

const buffer = Buffer.from(Obj.base64Img, "base64");

writeFileSync(saveFilename, buffer);

// Anime diffusion will be added
// if this repo star reach >= 50.

type

type StableDiffusionResult = {
  process_time: number;
  seed: string;
  ext: string;
  mimetype: string;
  base64Img: string;
};

Nsfw

Bokepsin

import { bokepsin } from "@xct007/frieren-scraper";

// Get latest
const ArrObj = await bokepsin.latest();
console.log(ArrObj);

// search
const ArrObj = await bokepsin.search("query");
console.log(ArrObj);

// detail
const Obj = await bokepsin.latest("URL");
console.log(ArrObj);

type

type BokepSinLatestSearchResults = {
  title: string;
  views: string;
  duration: string;
  url: string;
  thumbnail: string;
}[];

type BokepSinDetail = {
  title: string;
  views: string;
  duration: string;
  thumbnail: string;
  embed: string;
};

Error Handling Example.

There is probably no need to use statement try/catch, it is already handle.

import { youtube } from "@xct007/frieren-scraper";

youtube.download("YOUTUBE_URL").then((Obj) => {
  if (Obj.error) {
    // Error
    console.log(Obj.);
    /*
      {
        "error": true,
        "message": ""
      }
    */
  } else {
    // ...Your code
    console.log(Obj);
  }
});

// Promise
const Obj = await youtube.download("YOUTUBE_URL");

if (Obj.error) {
  // Error
  console.log(Obj);
  /*
    {
      "error": true,
      "message": ""
    }
  */
} else {
  // ...Your code.
  console.log(Obj);
}

Note.

This repository project is a learning exercise, and as such it utilizes references from other open source repositories. No commercial use is intended, and all efforts have been made to ensure proper attribution has been given to any referenced libraries and code.

frieren-scraper's People

Contributors

xct007 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.