Flibsta API is available as a npm packages
Use yarn add flibusta
or npm install flibusta
- Clone repository
- Use
yarn install
ornpm install
- Use commands:
For simple search
yarn example-search-book-by-name [book name]
yarn example-search-authors [author name]
yarn example-search-book-by-series [series name]
For paginated search
yarn example-search-book-by-name-paginated [book name] [page number] [items limit count]
yarn example-search-authors-paginated [author name] [page number] [items limit count]
yarn example-search-book-by-series-paginated [series name] [page number] [items limit count]
id
- The id of author
getBooksByAuthorOpds(6116)
Response
[
{
"author": [
{
"name": "ΠΠΎΠ½Π°Π½ ΠΠΎΠΉΠ»Ρ ΠΡΡΡΡ",
"uri": "/a/6116"
}
],
"title": "Β«ΠΠ»ΠΎΡΠΈΡ Π‘ΠΊΠΎΡΡΒ»",
"updated": "2022-02-22T08:35:39+01:00",
"categories": [
"ΠΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ²"
],
"cover": "/i/0/214600/cover.jpg",
"downloads": [
{
"link": "/b/214600/fb2",
"type": "application/fb2+zip"
},
{
"link": "/b/214600/html",
"type": "application/html+zip"
},
{
"link": "/b/214600/txt",
"type": "application/txt+zip"
},
{
"link": "/b/214600/rtf",
"type": "application/rtf+zip"
},
{
"link": "/b/214600/mobi",
"type": "application/x-mobipocket-ebook"
}
],
"description": "<p class=book>ΠΡΠ΄Π° ΠΈΡΡΠ΅Π· ΡΠ°Π²ΠΎΡΠΈΡ ΠΏΡΠ΅Π΄ΡΡΠΎΡΡΠΈΡ
ΡΠΊΠ°ΡΠ΅ΠΊ ΠΆΠ΅ΡΠ΅Π±Π΅Ρ Π‘Π΅ΡΠ΅Π±ΡΡΠ½ΡΠΉ ΠΈ ΠΊΡΠΎ ΡΠ±ΠΈΠ» Π΅Π³ΠΎ ΡΡΠ΅Π½Π΅ΡΠ°? ΠΡΠΎ ΠΏΡΡΠ°Π΅ΡΡΡ ΡΠ°Π·Π»ΡΡΠΈΡΡ ΡΡΠ°ΡΡΠ»ΠΈΠ²ΡΡ
ΡΡΠΏΡΡΠ³ΠΎΠ² ΠΡΠ½ΡΠΎ ΠΈ ΡΡΠΎ Π·Π° ΡΠΆΠ°ΡΠ½ΠΎΠ΅ Π»ΠΈΡΠΎ ΠΏΠΎΡΠ²Π»ΡΠ΅ΡΡΡ Π² ΠΎΠΊΠ½Π΅ ΡΠΎΡΠ΅Π΄Π½Π΅Π³ΠΎ Π΄ΠΎΠΌΠ°? Π ΠΊΠ°ΠΊΡΡ Π°ΡΠ΅ΡΡ ΠΎΠΊΠ°Π·Π°Π»ΡΡ Π²ΠΎΠ²Π»Π΅ΡΠ΅Π½ Π½Π΅Π·Π°Π΄Π°ΡΠ»ΠΈΠ²ΡΠΉ Π±ΠΈΡΠΆΠ΅Π²ΠΎΠΉ ΠΌΠ°ΠΊΠ»Π΅Ρ? Π ΡΡΠΎ Π΄Π΅Π»Π°Π»ΠΈ ΡΠ°ΠΈΠ½ΡΡΠ²Π΅Π½Π½ΡΠ΅ Π³ΠΎΡΡΠΈ ΠΈΠ· Π ΠΎΡΡΠΈΠΈ Π² ΠΊΠΎΠΌΠ½Π°ΡΠ΅ ΠΏΠ°ΡΠΈΠ΅Π½ΡΠ° Π΄ΠΎΠΊΡΠΎΡΠ° Π’ΡΠ΅Π²Π΅Π»ΡΡΠ½Π°? ΠΠ° ΡΡΠΈ Π²ΠΎΠΏΡΠΎΡΡ Π±Π΅ΡΠ΅ΡΡΡ ΠΎΡΠ²Π΅ΡΠΈΡΡ Π·Π½Π°ΠΌΠ΅Π½ΠΈΡΡΠΉ Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ... </p>\n <br/>ΠΠ΅ΡΠ΅Π²ΠΎΠ΄: ΠΡΠ±ΠΈΠΌΠΎΠ²Π° ΠΠ°Π»ΠΈΠ½Π°<br/>Π€ΠΎΡΠΌΠ°Ρ: fb2<br/>Π―Π·ΡΠΊ: ru<br/>Π Π°Π·ΠΌΠ΅Ρ: 62 Kb<br/>Π‘ΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠΉ: 8387<br/>Π‘Π΅ΡΠΈΡ: Π Π°ΡΡΠΊΠ°Π·Ρ ΠΎ Π¨Π΅ΡΠ»ΠΎΠΊΠ΅ Π₯ΠΎΠ»ΠΌΡΠ΅ β 2. ΠΠ°ΠΏΠΈΡΠΊΠΈ ΠΎ Π¨Π΅ΡΠ»ΠΎΠΊΠ΅ Π₯ΠΎΠ»ΠΌΡΠ΅ #4<br/>"
},
...
]
id
- The id of authorpage?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default20
.
getBooksByAuthorOpdsPaginated(6116)
Response
{
"items": [
{
"author": [
{
"name": "ΠΠΎΠ½Π°Π½ ΠΠΎΠΉΠ»Ρ ΠΡΡΡΡ",
"uri": "/a/6116"
}
],
"title": "Β«ΠΠ»ΠΎΡΠΈΡ Π‘ΠΊΠΎΡΡΒ»",
"updated": "2022-02-22T08:35:39+01:00",
"categories": [
"ΠΠ»Π°ΡΡΠΈΡΠ΅ΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ²"
],
"cover": "/i/0/214600/cover.jpg",
"downloads": [
{
"link": "/b/214600/fb2",
"type": "application/fb2+zip"
},
{
"link": "/b/214600/html",
"type": "application/html+zip"
},
{
"link": "/b/214600/txt",
"type": "application/txt+zip"
},
{
"link": "/b/214600/rtf",
"type": "application/rtf+zip"
},
{
"link": "/b/214600/mobi",
"type": "application/x-mobipocket-ebook"
}
],
"description": "<p class=book>ΠΡΠ΄Π° ΠΈΡΡΠ΅Π· ΡΠ°Π²ΠΎΡΠΈΡ ΠΏΡΠ΅Π΄ΡΡΠΎΡΡΠΈΡ
ΡΠΊΠ°ΡΠ΅ΠΊ ΠΆΠ΅ΡΠ΅Π±Π΅Ρ Π‘Π΅ΡΠ΅Π±ΡΡΠ½ΡΠΉ ΠΈ ΠΊΡΠΎ ΡΠ±ΠΈΠ» Π΅Π³ΠΎ ΡΡΠ΅Π½Π΅ΡΠ°? ΠΡΠΎ ΠΏΡΡΠ°Π΅ΡΡΡ ΡΠ°Π·Π»ΡΡΠΈΡΡ ΡΡΠ°ΡΡΠ»ΠΈΠ²ΡΡ
ΡΡΠΏΡΡΠ³ΠΎΠ² ΠΡΠ½ΡΠΎ ΠΈ ΡΡΠΎ Π·Π° ΡΠΆΠ°ΡΠ½ΠΎΠ΅ Π»ΠΈΡΠΎ ΠΏΠΎΡΠ²Π»ΡΠ΅ΡΡΡ Π² ΠΎΠΊΠ½Π΅ ΡΠΎΡΠ΅Π΄Π½Π΅Π³ΠΎ Π΄ΠΎΠΌΠ°? Π ΠΊΠ°ΠΊΡΡ Π°ΡΠ΅ΡΡ ΠΎΠΊΠ°Π·Π°Π»ΡΡ Π²ΠΎΠ²Π»Π΅ΡΠ΅Π½ Π½Π΅Π·Π°Π΄Π°ΡΠ»ΠΈΠ²ΡΠΉ Π±ΠΈΡΠΆΠ΅Π²ΠΎΠΉ ΠΌΠ°ΠΊΠ»Π΅Ρ? Π ΡΡΠΎ Π΄Π΅Π»Π°Π»ΠΈ ΡΠ°ΠΈΠ½ΡΡΠ²Π΅Π½Π½ΡΠ΅ Π³ΠΎΡΡΠΈ ΠΈΠ· Π ΠΎΡΡΠΈΠΈ Π² ΠΊΠΎΠΌΠ½Π°ΡΠ΅ ΠΏΠ°ΡΠΈΠ΅Π½ΡΠ° Π΄ΠΎΠΊΡΠΎΡΠ° Π’ΡΠ΅Π²Π΅Π»ΡΡΠ½Π°? ΠΠ° ΡΡΠΈ Π²ΠΎΠΏΡΠΎΡΡ Π±Π΅ΡΠ΅ΡΡΡ ΠΎΡΠ²Π΅ΡΠΈΡΡ Π·Π½Π°ΠΌΠ΅Π½ΠΈΡΡΠΉ Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ... </p>\n <br/>ΠΠ΅ΡΠ΅Π²ΠΎΠ΄: ΠΡΠ±ΠΈΠΌΠΎΠ²Π° ΠΠ°Π»ΠΈΠ½Π°<br/>Π€ΠΎΡΠΌΠ°Ρ: fb2<br/>Π―Π·ΡΠΊ: ru<br/>Π Π°Π·ΠΌΠ΅Ρ: 62 Kb<br/>Π‘ΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠΉ: 8387<br/>Π‘Π΅ΡΠΈΡ: Π Π°ΡΡΠΊΠ°Π·Ρ ΠΎ Π¨Π΅ΡΠ»ΠΎΠΊΠ΅ Π₯ΠΎΠ»ΠΌΡΠ΅ β 2. ΠΠ°ΠΏΠΈΡΠΊΠΈ ΠΎ Π¨Π΅ΡΠ»ΠΎΠΊΠ΅ Π₯ΠΎΠ»ΠΌΡΠ΅ #4<br/>"
},
...
],
"currentPage": 0,
"hasNextPage": true,
"hasPreviousPage": false
}
name
- The name of searched books.
getBooksByName('Π¨Π΅ΡΠ»ΠΎΠΊ')
Response
[
{
"book": {
"id": 402475,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ ΠΈ Π΄Π΅Π»ΠΎ ΠΎ ΠΏΠ°ΠΏΠΈΡΡΡΠ΅ (ΡΠ±ΠΎΡΠ½ΠΈΠΊ) [= Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ ΠΏΡΠΎΡΠΈΠ² Π³ΡΠ°ΡΠ° ΠΡΠ°ΠΊΡΠ»Ρ (ΡΠ±ΠΎΡΠ½ΠΈΠΊ)]"
},
"authors": [
{
"id": 33441,
"name": "ΠΡΠ²ΠΈΠ΄ Π‘ΡΡΠ°ΡΡ ΠΡΠ²ΠΈΡ"
}
]
},
...
]
name
- The name of searched books.
getBooksByNameFromOpds('Π¨Π΅ΡΠ»ΠΎΠΊ')
Response
[
{
"author": [
{
"name": "Π’Π°Π»ΡΡΡ
Π°Π½ΠΎΠ² ΠΠ΄ΠΈΠ»Ρ",
"uri": "/a/31745"
}
],
"title": "`ΠΡΡΡ Π±Π΅ΡΡ
Π²ΠΎΡΡΠΎΠΉ ΠΏΡΠΈΡΠΊΠΈ` ΠΈΠ»ΠΈ ΠΠ΅ΡΠΎΠ³Π»ΠΈΡΠΈΠΊΠ° ΠΏΠΎ ΠΌΠ΅ΡΠΎΠ΄Ρ Π¨Π΅ΡΠ»ΠΎΠΊΠ° Π₯ΠΎΠ»ΠΌΡΠ°",
"updated": "2022-02-18T07:21:09+01:00",
"categories": [
"Π―Π·ΡΠΊΠΎΠ·Π½Π°Π½ΠΈΠ΅, ΠΈΠ½ΠΎΡΡΡΠ°Π½Π½ΡΠ΅ ΡΠ·ΡΠΊΠΈ"
],
"downloads": [
{
"link": "/b/112478/download",
"type": "application/pdf+rar"
}
],
"description": "Π€ΠΎΡΠΌΠ°Ρ: pdf<br/>Π―Π·ΡΠΊ: ru<br/>Π Π°Π·ΠΌΠ΅Ρ: 564 Kb<br/>Π‘ΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠΉ: 2632<br/>"
},
...
]
name
- The name of searched books.page?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default20
.
getBooksByNameFromOpdsPaginated('Π¨Π΅ΡΠ»ΠΎΠΊ', 0, 1)
Response
{
"items": [
{
"author": [
{
"name": "Π’Π°Π»ΡΡΡ
Π°Π½ΠΎΠ² ΠΠ΄ΠΈΠ»Ρ",
"uri": "/a/31745"
}
],
"title": "`ΠΡΡΡ Π±Π΅ΡΡ
Π²ΠΎΡΡΠΎΠΉ ΠΏΡΠΈΡΠΊΠΈ` ΠΈΠ»ΠΈ ΠΠ΅ΡΠΎΠ³Π»ΠΈΡΠΈΠΊΠ° ΠΏΠΎ ΠΌΠ΅ΡΠΎΠ΄Ρ Π¨Π΅ΡΠ»ΠΎΠΊΠ° Π₯ΠΎΠ»ΠΌΡΠ°",
"updated": "2022-02-18T18:01:50+01:00",
"categories": [
"Π―Π·ΡΠΊΠΎΠ·Π½Π°Π½ΠΈΠ΅, ΠΈΠ½ΠΎΡΡΡΠ°Π½Π½ΡΠ΅ ΡΠ·ΡΠΊΠΈ"
],
"downloads": [
{
"link": "/b/112478/download",
"type": "application/pdf+rar"
}
],
"description": "Π€ΠΎΡΠΌΠ°Ρ: pdf<br/>Π―Π·ΡΠΊ: ru<br/>Π Π°Π·ΠΌΠ΅Ρ: 564 Kb<br/>Π‘ΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΠΉ: 2632<br/>"
}
],
"currentPage": 0,
"totalCountItems": 228,
"hasNextPage": true,
"hasPreviousPage": false,
"totalPages": 11
}
name
- The name of searched books.page?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default50
.
getBooksByNamePaginated('Π¨Π΅ΡΠ»ΠΎΠΊ', 0, 1)
Response
{
"items": [
{
"book": {
"id": 402475,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ ΠΈ Π΄Π΅Π»ΠΎ ΠΎ ΠΏΠ°ΠΏΠΈΡΡΡΠ΅ (ΡΠ±ΠΎΡΠ½ΠΈΠΊ) [= Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ ΠΏΡΠΎΡΠΈΠ² Π³ΡΠ°ΡΠ° ΠΡΠ°ΠΊΡΠ»Ρ (ΡΠ±ΠΎΡΠ½ΠΈΠΊ)]"
},
"authors": [
{
"id": 33441,
"name": "ΠΡΠ²ΠΈΠ΄ Π‘ΡΡΠ°ΡΡ ΠΡΠ²ΠΈΡ"
}
]
}
],
"currentPage": 0,
"totalCountItems": 228,
"totalPages": 5,
"hasNextPage": true,
"hasPreviousPage": false
}
name
- The name of searched books series.
getBooksBySeries('Π¨Π΅ΡΠ»ΠΎΠΊ')
Response
[
{
"id": 242,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ Ρ ΠΈΠ»Π»ΡΡΡΡΠ°ΡΠΈΡΠΌΠΈ",
"books": 11
},
{
"id": 30097,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ. ΠΠ³ΡΠ° ΠΏΡΠΎΠ΄ΠΎΠ»ΠΆΠ°Π΅ΡΡΡ",
"books": 61
},
{
"id": 4154,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ. ΠΠΎΠ²ΡΠ΅ ΠΏΡΠΈΠΊΠ»ΡΡΠ΅Π½ΠΈΡ",
"books": 8
},
...
]
name
- The name of searched books series.page?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default50
.
getBooksBySeriesPaginated('Π¨Π΅ΡΠ»ΠΎΠΊ', 0, 1)
Response
{
"items": [
{
"id": 242,
"name": "Π¨Π΅ΡΠ»ΠΎΠΊ Π₯ΠΎΠ»ΠΌΡ Ρ ΠΈΠ»Π»ΡΡΡΡΠ°ΡΠΈΡΠΌΠΈ",
"books": 11
}
],
"currentPage": 0,
"totalCountItems": 39,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
name
- The name of searched author.
getAuthors('ΠΊΠΎΠ½Π°Π½')
Response
[
{
"id": 6116,
"name": "ΠΡΡΡΡ ΠΠΎΠ½Π°Π½ ΠΠΎΠΉΠ»Ρ",
"books": 584,
"translations": -1
},
{
"id": 17933,
"name": "ΠΠ΄ΡΠΈΠ°Π½ ΠΠΎΠ½Π°Π½ ΠΠΎΠΉΠ»",
"books": 37,
"translations": -1
},
{
"id": 147059,
"name": "ΠΠ½Π΄ΡΠ΅Π°Ρ ΠΠΎΠ½Π°Π½ΠΎΡ (Π°ΡΡ
ΠΈΠΌΠ°Π½Π΄ΡΠΈΡ)",
"books": 19,
"translations": -1
},
{
"id": 6118,
"name": "Π‘ΡΡΠ·Π°Π½ ΠΠΎΠ½Π°Π½Ρ",
"books": 4,
"translations": -1
},
{
"id": 58754,
"name": "ΠΠ»Π΅ΠΊΡΠ°Π½Π΄Ρ ΠΠΎΠ½Π°Π½ΡΡ
ΠΈΠ½",
"books": -1,
"translations": 1
}
]
name
- The name of searched author.page?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default50
.
getAuthorsPaginated('ΠΊΠΎΠ½Π°Π½', 0, 1)
Response
{
"items": [
{
"id": 6116,
"name": "ΠΡΡΡΡ ΠΠΎΠ½Π°Π½ ΠΠΎΠΉΠ»Ρ",
"books": 584,
"translations": -1
}
],
"currentPage": 0,
"totalCountItems": 5,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
id
- The book id
getCoverByBookId(226302)
Response
File blob
name
- The name of searched genre.
getGenres('ΡΠΎΠΌΠ°Π½')
Response
[
{
"id": "det_irony",
"name": "ΠΡΠΎΠ½ΠΈΡΠ΅ΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ², Π΄Π°ΠΌΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ²Π½ΡΠΉ ΡΠΎΠΌΠ°Π½"
},
{
"id": "love_contemporary",
"name": "Π‘ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π»ΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
},
{
"id": "love_history",
"name": "ΠΡΡΠΎΡΠΈΡΠ΅ΡΠΊΠΈΠ΅ Π»ΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
},
{
"id": "love_detective",
"name": "ΠΡΡΡΠΎΡΡΠΆΠ΅ΡΠ½ΡΠ΅ Π»ΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
},
{
"id": "love_short",
"name": "ΠΠΎΡΠΎΡΠΊΠΈΠ΅ Π»ΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
},
{
"id": "love",
"name": "ΠΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
},
{
"id": "love_sf",
"name": "ΠΡΠ±ΠΎΠ²Π½ΠΎΠ΅ ΡΡΠ½ΡΠ΅Π·ΠΈ, Π»ΡΠ±ΠΎΠ²Π½ΠΎ-ΡΠ°Π½ΡΠ°ΡΡΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΡΠΎΠΌΠ°Π½Ρ "
},
{
"id": "tale_chivalry",
"name": "Π ΡΡΠ°ΡΡΠΊΠΈΠΉ ΡΠΎΠΌΠ°Π½"
},
{
"id": "adv_story",
"name": "ΠΠ²Π°Π½ΡΡΡΠ½ΡΠΉ ΡΠΎΠΌΠ°Π½"
},
{
"id": "gothic_novel",
"name": "ΠΠΎΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΠΎΠΌΠ°Π½"
},
{
"id": "great_story",
"name": "Π ΠΎΠΌΠ°Π½, ΠΏΠΎΠ²Π΅ΡΡΡ"
},
{
"id": "astrology",
"name": "ΠΡΡΡΠΎΠ»ΠΎΠ³ΠΈΡ ΠΈ Ρ
ΠΈΡΠΎΠΌΠ°Π½ΡΠΈΡ"
}
]
name
- The name of searched genre.page?
- Optional to get books by name for page. By default0
.limit?
- Optional. Limit rows count initems
. By default50
.
getGenresPaginated('ΡΠΎΠΌΠ°Π½', 0, 2)
Response
{
"items": [
{
"id": "det_irony",
"name": "ΠΡΠΎΠ½ΠΈΡΠ΅ΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ², Π΄Π°ΠΌΡΠΊΠΈΠΉ Π΄Π΅ΡΠ΅ΠΊΡΠΈΠ²Π½ΡΠΉ ΡΠΎΠΌΠ°Π½"
},
{
"id": "love_contemporary",
"name": "Π‘ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π»ΡΠ±ΠΎΠ²Π½ΡΠ΅ ΡΠΎΠΌΠ°Π½Ρ"
}
],
"currentPage": 0,
"totalCountItems": 12,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
Thanks antis11 for an example
Example
import { SocksProxyAgent } from 'socks-proxy-agent';
import FlibustaAPI from 'flibusta';
(async () => {
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
const [/* original value */, /* path to the file */, authorName] = process.argv;
const flibustaApi = new FlibustaAPI('http://flibustaongezhld6dibs2dps6vm4nvqg2kp7vgowbu76tzopgnhazqd.onion', {
httpAgent: new SocksProxyAgent('socks5h://127.0.0.1:9050'),
});
const searchAuthorsResult = await flibustaApi.getAuthors(authorName);
console.log(JSON.stringify(searchAuthorsResult, undefined, 2));
})();