mirror of
https://github.com/artegoser/piped-api.git
synced 2025-02-23 20:51:27 +03:00
fix: change got to axios
This commit is contained in:
parent
c977203bfd
commit
dccc55d4b5
4 changed files with 57 additions and 244 deletions
|
@ -1,4 +1,4 @@
|
|||
import got from "got";
|
||||
import axios from "axios";
|
||||
import {
|
||||
Channel,
|
||||
Comments,
|
||||
|
@ -24,8 +24,8 @@ export class PipedAPI {
|
|||
* @return {Promise<any>} - A Promise that resolves to the parsed JSON data.
|
||||
*/
|
||||
private async _get(url: string) {
|
||||
const data = await got.get(`${this.host}${url}`);
|
||||
return JSON.parse(data.body);
|
||||
const data = await axios.get(`${this.host}${url}`);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue