Skip to content

URL

This module is designed for creating URL-based search queries and provides two main APIs: browseAnime and browseFilter.

browseAnime API

This function generates a URL for browsing a specific title/anime

paramstypeRequiredDescription
titlestringYesThe name of the title/anime.
originstringYesURL origin for animeflv.
pagestringOptionalPage number for pagination.

Examples

Search for a specific title on the mobile site
typescript
import { browseAnime } from '@untidy/animeflv';

const target = browseAnime('yu yu hakusho', 'https://m.animeflv.net/'); 

// target output: https://m.animeflv.net/browse?q=yu+yu+hakusho
import { browseAnime } from '@untidy/animeflv';

const target = browseAnime('yu yu hakusho', 'https://m.animeflv.net/'); 

// target output: https://m.animeflv.net/browse?q=yu+yu+hakusho
Search for animation as the title and retrieve results for page 2
typescript
import { browseAnime } from '@untidy/animeflv';

const target = browseAnime('animation', 'https://m.animeflv.net/', '2'); 

// target output: https://m.animeflv.net/browse?q=animation&page=2
import { browseAnime } from '@untidy/animeflv';

const target = browseAnime('animation', 'https://m.animeflv.net/', '2'); 

// target output: https://m.animeflv.net/browse?q=animation&page=2

browseFilter API

Generates a URL for applying filters

paramstypeRequiredDescription
optionsobjectOptionalA set of options to filter the search.
options.genrestring or string[]OptionalGenre(s) of the title.
options.yearstring or string[]OptionalYear(s) for filtering.
options.typestring or string[]OptionalType of the title.
options.statusstring or string[]OptionalStatus for filtering.
options.orderstringOptionalSort order, e.g., rating, updated, etc.
options.pagestringOptionalPage number for pagination
originstringYesURL origin for animeflv.

Examples

Search for movies released in 2023 and sort by recently updated
typescript
import { browseFilter, type Options } from '@untidy/animeflv/url';

const options: Options = {
  year: '2023',
  type: 'movie',
  order: 'updated',
};

const target = browseFilter(options, 'https://www3.animeflv.net/'); 

// target output: https://www3.animeflv.net/browse?year=2023&type=movie&order=updated
import { browseFilter, type Options } from '@untidy/animeflv/url';

const options: Options = {
  year: '2023',
  type: 'movie',
  order: 'updated',
};

const target = browseFilter(options, 'https://www3.animeflv.net/'); 

// target output: https://www3.animeflv.net/browse?year=2023&type=movie&order=updated
Filter titles by genres released in 2023 that are currently on air
typescript
import { browseFilter, type Options } from '@untidy/animeflv/url';

const options: Options = {
  year: '2023',
  status: '1',
  genre: ['seinen', 'superpoderes'],
};

const target = browseFilter(options, 'https://www3.animeflv.net/'); 

// target output: https://www3.animeflv.net/browse?year=2023&status=1&genre%5B%5D=seinen&genre%5B%5D=superpoderes
import { browseFilter, type Options } from '@untidy/animeflv/url';

const options: Options = {
  year: '2023',
  status: '1',
  genre: ['seinen', 'superpoderes'],
};

const target = browseFilter(options, 'https://www3.animeflv.net/'); 

// target output: https://www3.animeflv.net/browse?year=2023&status=1&genre%5B%5D=seinen&genre%5B%5D=superpoderes