Coder Social home page Coder Social logo

pixiv-app-api's Introduction

pixiv-app-api

styled with prettier All Contributors

Promise based pixiv API client

Inspired by upbit/pixivpy: Pixiv API for Python.

Features

  • Promise based
  • Converts the output json keys to camelCase
  • Converts the parameters to snakeCase
  • Supports API without login

Install

$ npm install --save pixiv-app-api

Usage

import PixivAppApi from 'pixiv-app-api' //const PixivAppApi = require("pixiv-app-api")
import pixivImg from 'pixiv-img' //const pixivImg = require("pixiv-img")
const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {
  camelcaseKeys: true,
})

;(async () => {
  await pixiv.login()
  const json = await pixiv.searchIllust('艦これ10000users入り')
  await pixivImg(json.illusts[0].imageUrls.large)
  console.log('finish')
})()

Typescript

All functions will return either a camelCaseType or a snake_case_type depending on the value of camelcaseKeys. For example:

//const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {camelcaseKeys: true})
interface PixivClient = {
  accessToken: string
  expiresIn: number
  tokenType: string
  scope: string
  refreshToken: string
  user: PixivClientUser
  deviceToken: string
}

//const pixiv = new PixivAppApi(process.env.NAME, process.env.PASSWORD, {camelcaseKeys: false})
interface Pixiv_Client = {
  access_token: string
  expires_in: number
  token_type: string
  scope: string
  refresh_token: string
  user: Pixiv_Client_User
  device_token: string
}

API

constructor(username?: string, password?: string, options? {camelcaseKeys?: boolean})

Creates a new PixivAppApi object. camelcaseKeys defaults to true if it is omitted.

login(username?: string, password?: string): Promise<PixivClient>

Logs into the API.

{
  "accessToken": "abcdefgabcdefgabcdefgabcdefg",
  "expiresIn": 3600,
  "tokenType": "bearer",
  "scope": "unlimited",
  "refreshToken": "abcdefgabcdefgabcdefgabcdefg",
  "user": {
    "profileImageUrls": {
      "px16x16": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_16.png",
      "px50x50": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_50.png",
      "px170x170": "https://i.pximg.net/user-profile/img/2016/12/07/18/45/34/11842543_d51209fed2b2566336b1296e07f49b81_170.png"
    },
    "id": "19785907",
    "name": "akameco",
    "account": "akameco",
    "mailAddress": "abcdefgabcdefgabcdefgabcdefg",
    "isPremium": true,
    "xRestrict": 2,
    "isMailAuthorized": true
  }
}

authInfo(): PixivClient

Gets your authInfo.

interface PixivClient {
  accessToken: string
  expiresIn: number
  tokenType: string
  scope: string
  refreshToken: string
  user: PixivClientUser
  deviceToken: string
}

makeIterable(resp: Object): AsyncIterable<Object>

const json = await pixiv.searchIllust('艦これ10000users入り')
let ar = []
for await (const r of pixiv.makeIterable(json)) {
  ar = ar.concat(r.illusts)
  await sleep(1000) // if the request rate is too high, pixiv might ban you
}
console.log(ar.length)

userDetail(id: ID, params?: PixivParams): Promise<PixivUserDetail>.

Get a user's profile.

export interface PixivUserDetail {
  user: PixivUser
  profile: {
    webpage: string
    gender: string
    birth: string
    birthDay: string
    birthYear: number
    region: string
    addressId: number
    countryCode: string
    job: string
    jobId: number
    totalFollowUsers: number
    totalMypixivUsers: number
    totalIllusts: number
    totalManga: number
    totalNovels: number
    totalIllustBookmarksPublic: number
    totalIllustSeries: number
    backgroundImageUrl: string
    twitterAccount: string
    twitterUrl: string
    pawooUrl: string
    isPremium: boolean
    isUsingCustomProfileImage: boolean
  }
  profilePublicity: {
    gender: string
    region: string
    birthDay: string
    birthYear: string
    job: string
    pawoo: boolean
  }
  workspace: {
    pc: string
    monitor: string
    tool: string
    scanner: string
    tablet: string
    mouse: string
    printer: string
    desktop: string
    music: string
    desk: string
    chair: string
    comment: string
    workspaceImageUrl: string | null
  }
}

The type PixivParams is defined as follows:

export interface PixivParams {
  userId?: number
  type?: string
  filter?: string
  restrict?: 'public' | 'private'
  illustId?: number
  contentType?: string
  includeTotalComments?: boolean
  includeRankingLabel?: boolean
  includeRankingIllusts?: boolean
  includeRankingNovels?: boolean
  mode?:
    | 'day'
    | 'week'
    | 'month'
    | 'day_male'
    | 'day_female'
    | 'week_original'
    | 'week_rookie'
    | 'day_r18'
    | 'day_male_r18'
    | 'day_female_r18'
    | 'week_r18'
    | 'week_r18g'
    | 'day_manga'
    | 'week_manga'
    | 'month_manga'
    | 'week_rookie_manga'
    | 'day_r18_manga'
    | 'week_r18_manga'
    | 'week_r18g_manga'
  word?: string
  searchTarget?:
    | 'partial_match_for_tags'
    | 'exact_match_for_tags'
    | 'title_and_caption'
  sort?: 'date_desc' | 'date_asc' | 'popular_desc'
  startDate?: string
  endDate?: string
  offset?: number
}

userIllusts(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Retrieves all of a users illusts.

export interface PixivIllustSearch {
  illusts: PixivIllust[]
  nextUrl: string | null
  searchSpanLimit?: number
}
{
  "illusts": [
    {
      "id": 64124918,
      "title": "Noise Pollution Vol.3",
      "type": "illust",
      "imageUrls": {
        "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p0_square1200.jpg",
        "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
        "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg"
      },
      "caption": "夏コミ新刊の②<br /><br />東レ54b-CREAYUS<br />Noise Pollution Vol.3には会場限定A5サイズのクリアファイルがつきます。1冊につき1枚(先着)、なくなり次第終了です。<br /><br />とらのあな予約(フルカラー全年齢)<br /><a href=\"http://www.toranoana.jp/mailorder/article/04/0030/54/88/040030548805.html?rec=circle\" target=\"_blank\">http://www.toranoana.jp/mailorder/article/04/0030/54/88/040030548805.html?rec=circle</a>",
      "restrict": 0,
      "user": {
        "id": 471355,
        "name": "嵐月",
        "account": "creayus",
        "profileImageUrls": {
          "medium": "https://i3.pixiv.net/user-profile/img/2014/02/02/00/05/39/7393018_f1ce44676a8c0d902cc49aad2828e510_170.jpg"
        },
        "isFollowed": true
      },
      "tags": [
        {
          "name": "C.C."
        },
        {
          "name": "ルルーシュ"
        },
        {
          "name": "ルルC"
        },
        {
          "name": "コードギアス"
        },
        {
          "name": "コードギアス1000users入り"
        },
        {
          "name": "ルルーシュ・ランペルージ"
        }
      ],
      "tools": ["Photoshop", "SAI"],
      "createDate": "2017-07-30T12:20:55+09:00",
      "pageCount": 5,
      "width": 900,
      "height": 633,
      "sanityLevel": 4,
      "metaSinglePage": {},
      "metaPages": [
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p0_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p0_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p0.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p1_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p1_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p1_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p1.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p2_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p2_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p2_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p2.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p3_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p3_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p3_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p3.png"
          }
        },
        {
          "imageUrls": {
            "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/07/30/12/20/55/64124918_p4_square1200.jpg",
            "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/07/30/12/20/55/64124918_p4_master1200.jpg",
            "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/07/30/12/20/55/64124918_p4_master1200.jpg",
            "original": "https://i.pximg.net/img-original/img/2017/07/30/12/20/55/64124918_p4.png"
          }
        }
      ],
      "totalView": 45180,
      "totalBookmarks": 2358,
      "isBookmarked": false,
      "visible": true,
      "isMuted": false,
      "totalComments": 33
    }
  ],
  "nextUrl": "https://app-api.pixiv.net/v1/user/illusts?user_id=471355&type=illust&filter=for_ios&offset=40"
}

userFollowAdd(id: ID, data?: Object): Promise<unknown>

Follows a user.

userFollowDelete(id: ID, data?: Object): Promise<unknown>

Unfollows a user.

userBookmarksIllust(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Gets a user's bookmarked illusts.

userFollowing(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets the users that a user is following.

export interface PixivUserSearch {
  userPreviews: {
    user: PixivUser
    illusts: PixivIllust[]
    novels: PixivNovel[]
    isMuted: boolean
  }[]
  nextUrl: string | null
}

userFollower(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets the users who follow a user.

userMypixiv(id: ID, params?: PixivParams): Promise<PixivUserSearch>

Gets your friends on Mypixiv.

userList(id: ID, params?: PixivParams): Promise<unknown>

Gets a user list.

illustDetail(id: ID, params?: PixivParams): Promise<PixivIllustDetail>

Returns detailed info for a pixiv illust.

export interface PixivIllustDetail {
  illust: PixivIllust
}

export interface PixivIllust {
  id: number
  title: string
  interface: string
  imageUrls: {
    squareMedium: string
    medium: string
    large?: string
  }
  caption: string
  restrict: number
  user: PixivUser
  tags: PixivTag[]
  tools: string[]
  createDate: string
  pageCount: number
  width: number
  height: number
  sanityLevel: number
  metaSinglePage: {
    originalImageUrl?: string
  }
  metaPages: PixivMetaPage[]
  totalView: number
  totalBookmarks: number
  isBookmarked: boolean
  visible: boolean
  isMuted: boolean
  totalComments: number
}
{
  "illust": {
    "id": 57907953,
    "title": "ロングヘアレムりん",
    "type": "illust",
    "imageUrls": {
      "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2016/07/15/00/08/24/57907953_p0_square1200.jpg",
      "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2016/07/15/00/08/24/57907953_p0_master1200.jpg",
      "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2016/07/15/00/08/24/57907953_p0_master1200.jpg"
    },
    "caption": "デイリー32→5 ありがとうございます!",
    "restrict": 0,
    "user": {
      "id": 3424578,
      "name": "こーやふ@三日目東に26b",
      "account": "burittohiroba",
      "profileImageUrls": {
        "medium": "https://i2.pixiv.net/user-profile/img/2017/02/07/16/03/00/12115481_03cc0ec0f2580ac4a12a3682929b485a_170.jpg"
      },
      "isFollowed": false
    },
    "tags": [
      {
        "name": "Re:ゼロから始める異世界生活"
      },
      {
        "name": "レム"
      },
      {
        "name": "リゼロ"
      },
      {
        "name": "レム(リゼロ)"
      },
      {
        "name": "ナツキ・レム"
      },
      {
        "name": "リゼロ10000users入り"
      },
      {
        "name": "スバレム"
      },
      {
        "name": "メイド"
      },
      {
        "name": "ロング化"
      }
    ],
    "tools": [],
    "createDate": "2016-07-15T00:08:24+09:00",
    "pageCount": 1,
    "width": 1000,
    "height": 1412,
    "sanityLevel": 2,
    "metaSinglePage": {
      "originalImageUrl": "https://i.pximg.net/img-original/img/2016/07/15/00/08/24/57907953_p0.jpg"
    },
    "metaPages": [],
    "totalView": 191059,
    "totalBookmarks": 28918,
    "isBookmarked": false,
    "visible": true,
    "isMuted": false,
    "totalComments": 181
  }
}

illustNew(params?: PixivParams): Promise<PixivIllustSearch>

Searches new illusts.

illustFollow(params?: PixivParams): Promise<PixivIllustSearch>

Searches new illusts from users you follow.

{
  "illusts": [
    {
      "id": 64419500,
      "title": "【PFRD】Chapter.6",
      "type": "illust",
      "imageUrls": {
        "squareMedium": "https://i.pximg.net/c/360x360_70/img-master/img/2017/08/15/00/16/32/64419500_p0_square1200.jpg",
        "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2017/08/15/00/16/32/64419500_p0_master1200.jpg",
        "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2017/08/15/00/16/32/64419500_p0_master1200.jpg"
      },
      "caption": "法尔卡岛.缇拉密林带 <br />挡在阿尔卡娜面前的数个复活者每个个体都带着伤,从摆起的架势来看也似乎毫无章法,但天生的直觉依然如同警铃般急促的敲打着阿尔卡娜的心。<br />“我这是在...害怕么?“感受到握剑的右手微微颤抖,阿尔卡娜自嘲的轻笑”呵..我还以为我已经忘了害怕是什么了呢”。<br /><br />来吧,不管【你们】是什么,堂堂正正的一决胜负吧!",
      "restrict": 0,
      "user": {
        "id": 22124330,
        "name": "超凶の狄璐卡",
        "account": "swd3e22",
        "profileImageUrls": {
          "medium": "https://i4.pixiv.net/user-profile/img/2017/01/10/13/28/42/11988991_bae951a38d31d217fa1eceedc0aafdbe_170.jpg"
        },
        "isFollowed": true
      },
      "tags": [
        {
          "name": "女の子"
        },
        {
          "name": "落書"
        },
        {
          "name": "オリジナル"
        },
        {
          "name": "グランメイル"
        },
        {
          "name": "pixivファンタジアRD"
        },
        {
          "name": "不敗王の復活"
        },
        {
          "name": "復活者討伐戦【青】"
        }
      ],
      "tools": [],
      "createDate": "2017-08-15T00:16:32+09:00",
      "pageCount": 1,
      "width": 2126,
      "height": 1150,
      "sanityLevel": 4,
      "metaSinglePage": {
        "originalImageUrl": "https://i.pximg.net/img-original/img/2017/08/15/00/16/32/64419500_p0.jpg"
      },
      "metaPages": [],
      "totalView": 228,
      "totalBookmarks": 63,
      "isBookmarked": false,
      "visible": true,
      "isMuted": false
    }
  ],
  "nextUrl": "https://app-api.pixiv.net/v2/illust/follow?restrict=public&offset=30"
}

illustComments(id: ID, params?: PixivParams): Promise<PixivCommentSearch>

Returns the comments on an illust.

export interface PixivCommentSearch {
  totalComments: number
  comments: PixivComment[]
  nextUrl: string | null
}

illustRelated(id: ID, params?: PixivParams): Promise<PixivIllustSearch>

Searches for illusts related to the one provided.

illustRecommended(params?: PixivParams): Promise<PixivIllustSearch>

Returns recommended illusts.

illustRecommendedNologin(params?: PixivParams): Promise<PixivIllustSearch>

Returns recommended illusts (logged out).

illustRanking(params?: PixivParams): Promise<PixivIllustSearch>

Returns top daily illusts by default.

trendingTagsIllust(params?: PixivParams): Promise<PixivTrendTags>

Returns an array of trending tags.

export interface PixivTrendTags {
  trend_tags: PixivTag[]
}

searchIllust(word: Word, params?: PixivParams): Promise<PixivIllustSearch>

Searches for illusts with the provided query.

searchNovel(word: Word, params?: PixivParams): Promise<PixivNovelSearch>

Searches for novels with the provided query.

export interface PixivNovelSearch {
  novels: PixivNovel[]
  nextUrl: string | null
  privacyPolicy?: {}
  searchSpanLimit?: number
}

searchUser(word: Word, params?: PixivParams): Promise<PixivUserSearch>

Searches for users with the provided query.

searchAutoComplete(word: Word): Promise<PixivAutoComplete>

Returns an array of auto-completed words from the input.

export interface PixivAutoComplete {
  searchAutoCompleteKeywords: string[]
}

illustBookmarkDetail(id: ID, params?: PixivParams): Promise<PixivBookmarkDetail>

Returns detailed info on a bookmark.

export interface PixivBookmarkDetail {
  isBookmarked: boolean
  tags: PixivTag[]
  restrict: string
}
{
  "bookmarkDetail": {
    "isBookmarked": false,
    "tags": [
      {
        "name": "Re:ゼロから始める異世界生活",
        "isRegistered": false
      },
      {
        "name": "レム",
        "isRegistered": false
      },
      {
        "name": "リゼロ",
        "isRegistered": false
      },
      {
        "name": "レム(リゼロ)",
        "isRegistered": false
      },
      {
        "name": "ナツキ・レム",
        "isRegistered": false
      },
      {
        "name": "リゼロ10000users入り",
        "isRegistered": false
      },
      {
        "name": "スバレム",
        "isRegistered": false
      },
      {
        "name": "メイド",
        "isRegistered": false
      },
      {
        "name": "ロング化",
        "isRegistered": false
      }
    ],
    "restrict": "public"
  }
}

illustBookmarkAdd(id: ID, data?: Object): Promise<unknown>

Adds a new bookmark.

illustBookmarkDelete(id: ID, data?: Object): Promise<unknown>

Deletes a bookmark.

userBookmarkTagsIllust(params?: PixivParams): Promise<PixivBookmarkSearch>

Searches your bookmark tags.

export interface PixivBookmarkSearch {
  bookmarkTags: PixivTag[]
  nextUrl: string | null
}
{
  "bookmarkTags": [],
  "nextUrl": null
}

novelRecommended(params?: PixivParams): Promise<PixivNovelSearch>

Searches recommended novels.

mangaNew(params?: PixivParams): Promise<unknown>

Searches new manga.

mangaRecommended(params?: PixivParams): Promise<PixivMangaSearch>

Searches recommended manga.

export interface PixivMangaSearch {
  illusts: PixivManga[]
  rankingIllusts: PixivManga[] | []
  privacyPolicy: {}
  nextUrl: string | null
}

novelRecommendedNologin(params?: PixivParams): Promise<PixivNovelSearch>

Searches recommended novels (logged out).

novelNew(params?: PixivParams): Promise<PixivNovelSearch>

Searches new novels.

ugoiraMetaData(id: number, params?: PixivParams): Promise<UgoiraMetaData>

Retrieves the zip url and frames for a Pixiv Ugoira.

export interface UgoiraMetaData {
  ugoiraMetadata: {
    zipUrls: {
      medium: string
    }
    frames: {
      file: string
      delay: number
    }[]
  }
}

fetch(target: string, opts?: PixivFetchOptions): Promise<any>

Fetches a route in the Pixiv API and returns the result.

See Sniffer for iOS 6.x Common API · upbit/pixivpy Wiki

pixiv.next(): Promise<any>

Return next request result.

usage
pixiv
  .searchIllust(word)
  .then(() => pixiv.next())
  .then(() => pixiv.next())
  .then((json) => {
    console.log(json)
  })

pixiv.hasNext(): boolean

Return true if pixiv.next() is able to run.

usage
if (pixiv.hasNext()) {
  pixiv.next().then()
}

pixiv.nextQuery(): Promise<string | undefined>

Return next params parameter.

Tests

Export your pixiv username and password before running Tests.

$ export USERNAME=your pixiv username...
$ export PASSWORD=your pixiv password...
$ npm test

Related

Contributors

Thanks goes to these wonderful people (emoji key):


akameco

💻 📖 ⚠️ 🚇

Austin Huang

💻 📖

Cake

💻 ⚠️

Ade Firman Fauzi

💻

yeti2018

💻

maple

💻

Tenpi

💻 📖

yanagiragi

💻

NigridsVa

💻

Anton Grigoryev

💻

そら

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco

pixiv-app-api's People

Contributors

adefirmanf avatar akameco avatar antosik avatar dependabot[bot] avatar greenkeeper[bot] avatar jemiloii avatar jiefenghe avatar kokororin avatar maple3142 avatar najimi avatar nigridsva avatar tenpi avatar yanagiragi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pixiv-app-api's Issues

HTTP 403 on Auth

  • version: 1.21
  • node version: v14.14.0
  • npm (or yarn) version: 6.14.8

Do you want to request a feature or report a bug?: Bug

What is the current behavior?: Currently authenticating to Pixiv's API is throwing a 403 due to a Cloudflare ratelimit page requesting me to complete a captcha to continue

What is the expected behavior?: Authentication should succeed.

Suggested solution: It appears the Pixiv.py team are working through the same issue here: upbit/pixivpy#140

I personally edited my local dependency for testing and simply adding a 'User-Agent' header with the following value seems to have fixed the issue: PixivAndroidApp/5.0.115 (Android 6.0; PixivBot)

Perhaps adding an option to specify a User-Agent header would allow us to easily bypass this issue for the time being.

Requests timing out on server

  • version: 1.0.4
  • node version: 12.14.1
  • npm (or yarn) version: 6.13.6

Do you want to request a feature or report a bug?:

What is the current behavior?:
https://gist.github.com/Renari/ade19f8b4d28a5ad19f10253a40eb7e3

The above is constantly getting output to my log when deploying my code. I'm having difficulty reproducing the issue locally though.

What is the expected behavior?:
Requests to not time out.

Suggested solution:
Unknown

Status code 400

  • version: 0.12.1
  • node version: tested on v8.10.0 and v10.16.3
  • npm (or yarn) version: 3.5.2

Do you want to request a feature or report a bug?:

Bug

What is the current behavior?:

All operations throw a rejected promise: Error: Request failed with status code 400

What is the expected behavior?:

Server should return status code 200 😛

Suggested solution:

Maybe this API is deprecated...? Not sure, it worked yesterday. Tried a few different node-based pixiv clients to no avail.

Search Illust without login doesn't work anymore?

  • version:
  • node version: v9.8.0
  • npm (or yarn) version: 5.6.0

Do you want to request a feature or report a bug?:
Bug also probably features to change example documentation and error message
What is the current behavior?:
constructor without username & password arguments should be working, since on documentation said that. But, it got TypeError: Expected a string, got undefined

Example

const pixiv = new Pixiv(); // TypeError: Expected a string, got undefined
  pixiv.searchIllust('艦これ10000users入り')
    .then((json) => {
      console.log(json);
    }).catch((err) => {
      console.log(err);
    });

Suggested solution:
I know, this is due of API behavior, (Refer to commit message) :
upbit/pixivpy@7bd8e23

Feature request :

  • Change Error message : Auth is required. Expected a string, got ${typeof this.username}
  • Update example documentation

Param Lists?

Is it possible to have a list of params for most/all of the functions? I can't find them anywhere and it'd be pretty helpful in regards to using the library.

403 Forbidden

Node version: 9.5.0
npm version: 5.6.0

All the Urls in data sent back from .searchIllust() give me the error 403 Forbidden, i cannot access any of them.

pixiv_app_api_1.default is not a constructor

  • version:
  • node version: 13.0.1
  • npm (or yarn) version: 6.12.0

Do you want to request a feature or report a bug?:
Report a bug
What is the current behavior?:
Can't compile with TypeScript.
Error: TypeError: pixiv_app_api_1.default is not a constructor
Declared as:

import pixiv from "pixiv-app-api";

const api = new pixiv(process.env.USERNAME, process.env.PWD);

What is the expected behavior?:
A program compiling and working with pixiv API
Suggested solution:

Deprecated Examples & userFollowAdd not working

English
  • version:
  • node version: v8.12.0
  • npm (or yarn) version: 6.4.1

Do you want to request a feature or report a bug?:

2 bugs

What is the current behavior?:

  1. readme login example has been deprecated.

  2. userFollowAdd is not working

Tried:

  • userFollowAdd('4197637')

  • After login, call userFollowAdd('4197637')

  • userFollowAdd('4197637', {'publicity': 'public'})

  • userFollowAdd({'target_user_id': '4197637', 'publicity': 'public'})

What is the expected behavior?:

  1. See here for visualize comparision

  2. Should call as userFollowId(USER_ID_YOU_WISH_TO_FOLLOW) and successfully add to following list

Suggested solution:

I tried to implemented with reference of upbit/pixivpy

Here is the code. (Sorry for using request, I'm not familiar with Axios)

However, the implementation require pass access token in headers, so it may need to re-design instance in index.js, so I'm not sure which design suit best.

From other APIs, I'd tried

  • login

  • searchIllust

  • illustRanking

  • illustDetail

the above APIs worked fine 👍

How does session expiration work?

We are given both an expiresIn and a refreshToken variable. While trying to figure out how this works it seems expiresIn is always 3600. Is session renewal being handled automatically then?

Broken package on npm/yarn registry

  • version: 0.13.0
  • node version: v11.15.0
  • npm (or yarn) version: 6.10.3 (1.17.3)

Do you want to request a feature or report a bug?:
Bug
What is the current behavior?:
I can't get new version of library 0.13 as on master branch via yarn add/npm install
After I add or install 0.13 version of package, yarn/package.lock refers to registry with old flow types system
https://registry.npmjs.org/pixiv-app-api/-/pixiv-app-api-0.13.0.tgz
https://registry.yarnpkg.com/pixiv-app-api/-/pixiv-app-api-0.13.0.tgz#aa9e7a14e30a68fbb310561a51dabac33d88bc3a
Suggested solution:
Can you update package content on registry please to using typescript types in my project?

An API issue in document

In current document, illustFollow method only have one parameter,

illustFollow(params?: PixivParams): Promise

But it actually is

illustFollow(id: number, params?: PixivParams): Promise

another "status code 400"

  • version: 1.0.2
  • node version: v10.16.3
  • npm (or yarn) version: 6.11.3

Do you want to request a feature or report a bug?:
bug

What is the current behavior?:

const pixiv = new PixivAppApi(id, password);
pixiv.login(); // 200 ok
await pixiv.userDetail(123456); // Error: Request failed with status code 400

v1.0.2で一旦400が出なくなりましたが、本日試したところ再度400となっています。
以前と違いlogin() の時点ではエラーにならず、
userDetails や illustSearch などのメソッドを実行した際に400が返ってきます。

What is the expected behavior?:
api should return 200 ok

Suggested solution:
API has another braking-changes?

CORS Origin not Allowed

  • version:
  • node version: v.9.8.0
  • npm (or yarn) version: 5.6.0

Do you want to request a feature or report a bug?:
bug

What is the current behavior?:
Seems like CORS not allowed for all method. Including basic command. I'm trying to

const pixiv = new pixivAPI(process.env.USERNAME, process.env.PASSWORD)
        pixiv.searchIllust('艦これ10000users入り').then((response)=>{
            console.log(response)
        })
...

But, in my chrome I got log

Failed to load https://app-api.pixiv.net/v1/search/illust?word=%E8%89%A6%E3%81%93%E3%82%8C10000users%E5%85%A5%E3%82%8A&search_target=partial_match_for_tags&sort=date_desc&filter=for_ios: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 404.

maybe add socks5 support?

  • version:
  • node version:v14.16.0
  • npm (or yarn) version:6.14.11

Do you want to request a feature or report a bug?:
a feature
What is the current behavior?:
It get 404
What is the expected behavior?:
get correct response
Suggested solution:
add socks5 proxy support

"crypto" DepricationWarning

Hello!
Thanks for your work on this great project ^^

I'm working on CLI tool and after upgrade to v1.0.3 I found some deprication warnings on my console.
After investigation i found that it happens because of "crypto" package. Some of it parts are depricated and because package is fully imported they appears in "pixiv-app-api" too.

I will do a PR as soon as possible.

  • version:
  • node version: v10.3.0
  • npm (or yarn) version: npm v6.4.1

Do you want to request a feature or report a bug?:
Little bug

What is the current behavior?:
Some deprication messages in console

(node:13004) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.
(node:13004) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
(node:13004) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.

What is the expected behavior?:
No deprication messages ._.

Suggested solution:
Import only createHash function instead of all package.

Translated name of tags is always null

  • version:
  • node version: 14.11.0
  • npm (or yarn) version: 1.22.10

Do you want to request a feature or report a bug?: Bug?

What is the current behavior?:
When calling illustDetail() or userIllusts(), the "translated_name" of a tag is ALWAYS null. I must either be stupid or it doesn't work anymore.

What is the expected behavior?:
Most tags have a translated name. PxView, which is using pixiv-app-api, displays translated tags normally. So it did work at some point.

Unable import library as typescript module

  • version: 0.14.0
  • node version: 12.9.1
  • npm (or yarn) version: 6.11.2 (1.17.3)

I can't import this library as typescript module.
If I use imports like:
import PixivAppApi from 'pixiv-app-api';
I get undefined
If I import like:
import * as PixivAppApi from 'pixiv-app-api';
I get function, but my code falls with:
TypeError: pixiv_app_api_1.default is not a constructor
But if I use CommonJS import instead TypeScript import (import library as JavaScript module) class constructor works fine.
const PixivAppApi = require('pixiv-app-api');
Could you make TypeScript import with avalible types possible?

userFollowing Temporarily response 403

  • version:
  • node version: 11.12.0
  • npm (or yarn) version: npm 6.7.0

Do you want to request a feature or report a bug?:

bug

What is the current behavior?:

calling userFollowing sometimes response 403, any idea why?

Below is the testing code.

const Pixiv = require('pixiv-app-api')

let pix = new Pixiv('ACCOUNT', 'PASSWORD')

pix.userFollowing('1655331')
    .catch(err => console.log(err))
    .then(data => console.log(data))

and here's some log:

root@8a393d977e7d:~/Pixiv-Downloader/bin# node test.js                                                              
{ Error: Request failed with status code 403                                                                        
    at createError (/root/Pixiv-Downloader/node_modules/axios/lib/core/createError.js:16:15)                        
    at settle (/root/Pixiv-Downloader/node_modules/axios/lib/core/settle.js:18:12)                                  
    at IncomingMessage.handleStreamEnd (/root/Pixiv-Downloader/node_modules/axios/lib/adapters/http.js:201:11)      
    at IncomingMessage.emit (events.js:202:15)                                                                      
    at endReadableNT (_stream_readable.js:1132:12)                                                                  
    at processTicksAndRejections (internal/process/next_tick.js:76:17)                                              
  config:                                                                                                           
   { adapter: [Function: httpAdapter],                                                                              
     transformRequest: { '0': [Function: transformRequest] },                                                       
     transformResponse: { '0': [Function: transformResponse] },                                                     
     timeout: 0,                                                                                                    
     xsrfCookieName: 'XSRF-TOKEN',                                                                                  
     xsrfHeaderName: 'X-XSRF-TOKEN',                                                                                
     maxContentLength: -1,                                                                                          
     validateStatus: [Function: validateStatus],                                                                    
     headers:                                                                                                       
      { Accept: 'application/json, text/plain, */*',                                                                
        Authorization: 'Bearer ***************************',                                        
        'App-OS': 'ios',                                                                                            
        'App-OS-Version': '9.3.3',                                                                                  
        'App-Version': '6.0.9',                                                                                     
        'User-Agent': 'axios/0.18.0' },                                                                             
     method: 'get',                                                                                                 
     baseURL: 'https://app-api.pixiv.net/',                                                                         
     url: 'https://app-api.pixiv.net/v1/user/following',                                                            
     params: { user_id: '1655331', restrict: 'public' },                                                            
     data: undefined },                                                                                             
  request:                                                                                                          
   ClientRequest {                                                                                                  
     _events:                                                                                                       
      [Object: null prototype] {                                                                                    
        socket: [Function],                                                                                         
        abort: [Function],                                                                                          
        aborted: [Function],                                                                                        
        error: [Function],                                                                                          
        timeout: [Function],                                                                                        
        prefinish: [Function: requestOnPrefinish] },                                                                
     _eventsCount: 6,                                                                                               
     _maxListeners: undefined,                                                                                      
     outputData: [],                                                                                                
     outputSize: 0,                                                                                                 
     writable: true,                                                                                                
     _last: true,                                                                                                   
     chunkedEncoding: false,                                                                                        
     shouldKeepAlive: false,                                                                                        
     useChunkedEncodingByDefault: false,                                                                            
     sendDate: false,                                                                                               
     _removedConnection: false,                                                                                     
     _removedContLen: false,                                                                                        
     _removedTE: false,                                                                                             
     _contentLength: 0,                                                                                             
     _hasBody: true,                                                                                                
     _trailer: '',                                                                                                  
     finished: true,                                                                                                
     _headerSent: true,                                                                                             
     socket:                                                                                                        
      TLSSocket {                                                                                                   
        _tlsOptions: [Object],                                                                                      
        _secureEstablished: true,                                                                                   
        _securePending: false,                                                                                      
        _newSessionPending: false,                                                                                  
        _controlReleased: true,                                                                                     
        _SNICallback: null,                                                                                         
        servername: 'app-api.pixiv.net',                                                                            
        alpnProtocol: false,                                                                                        
        authorized: true,                                                                                           
        authorizationError: null,                                                                                   
        encrypted: true,                                                                                            
        _events: [Object],                                                                                          
        _eventsCount: 9,                                                                                            
        connecting: false,                                                                                          
        _hadError: false,                                                                                           
        _parent: null,                                                                                              
        _host: 'app-api.pixiv.net',                                                                                 
        _readableState: [ReadableState],                                                                            
        readable: true,                                                                                             
        _maxListeners: undefined,                                                                                   
        _writableState: [WritableState],                                                                            
        writable: false,                                                                                            
        allowHalfOpen: false,                                                                                       
        _sockname: null,                                                                                            
        _pendingData: null,                                                                                         
        _pendingEncoding: '',                                                                                       
        server: undefined,                                                                                          
        _server: null,                                                                                              
        ssl: [TLSWrap],                                                                                             
        _requestCert: true,                                                                                         
        _rejectUnauthorized: true,                                                                                  
        parser: null,                                                                                               
        _httpMessage: [Circular],                                                                                   
        [Symbol(res)]: [TLSWrap],                                                                                   
        [Symbol(asyncId)]: 47,                                                                                      
        [Symbol(kHandle)]: [TLSWrap],                                                                               
        [Symbol(lastWriteQueueSize)]: 0,                                                                            
        [Symbol(timeout)]: null,                                                                                    
        [Symbol(kBytesRead)]: 0,                                                                                    
        [Symbol(kBytesWritten)]: 0,                                                                                 
        [Symbol(connect-options)]: [Object] },                                                                      
     connection:                                                                                                    
      TLSSocket {                                                                                                   
        _tlsOptions: [Object],                                                                                      
        _secureEstablished: true,                                                                                   
        _securePending: false,                                                                                      
        _newSessionPending: false,                                                                                  
        _controlReleased: true,                                                                                     
        _SNICallback: null,                                                                                         
        servername: 'app-api.pixiv.net',                                                                            
        alpnProtocol: false,                                                                                        
        authorized: true,                                                                                           
        authorizationError: null,                                                                                   
        encrypted: true,                                                                                            
        _events: [Object],                                                                                          
        _eventsCount: 9,                                                                                            
        connecting: false,                                                                                          
        _hadError: false,                                                                                           
        _parent: null,                                                                                              
        _host: 'app-api.pixiv.net',                                                                                 
        _readableState: [ReadableState],                                                                            
        readable: true,                                                                                             
        _maxListeners: undefined,                                                                                   
        _writableState: [WritableState],                                                                            
        writable: false,                                                                                            
        allowHalfOpen: false,                                                                                       
        _sockname: null,                                                                                            
        _pendingData: null,                                                                                         
        _pendingEncoding: '',                                                                                       
        server: undefined,                                                                                          
        _server: null,                                                                                              
        ssl: [TLSWrap],                                                                                             
        _requestCert: true,                                                                                         
        _rejectUnauthorized: true,                                                                                  
        parser: null,                                                                                               
        _httpMessage: [Circular],                                                                                   
        [Symbol(res)]: [TLSWrap],                                                                                   
        [Symbol(asyncId)]: 47,                                                                                      
        [Symbol(kHandle)]: [TLSWrap],                                                                               
        [Symbol(lastWriteQueueSize)]: 0,                                                                            
        [Symbol(timeout)]: null,                                                                                    
        [Symbol(kBytesRead)]: 0,                                                                                    
        [Symbol(kBytesWritten)]: 0,                                                                                 
        [Symbol(connect-options)]: [Object] },                                                                      
     _header:                                                                                                       
      'GET /v1/user/following?user_id=1655331&restrict=public HTTP/1.1\r\nAccept: application/json, text/plain, */*\
\nAuthorization: Bearer ***************************\r\nApp-OS: ios\r\nApp-OS-Version: 9.3.3\r\nApp-V
rsion: 6.0.9\r\nUser-Agent: axios/0.18.0\r\nHost: app-api.pixiv.net\r\nConnection: close\r\n\r\n',                  
     _onPendingData: [Function: noopPendingOutput],                                                                 
     agent:                                                                                                         
      Agent {                                                                                                       
        _events: [Object],                                                                                          
        _eventsCount: 1,                                                                                            
        _maxListeners: undefined,                                                                                   
        defaultPort: 443,                                                                                           
        protocol: 'https:',                                                                                         
        options: [Object],                                                                                          
        requests: {},                                                                                               
        sockets: [Object],                                                                                          
        freeSockets: {},                                                                                            
        keepAliveMsecs: 1000,                                                                                       
        keepAlive: false,                                                                                           
        maxSockets: Infinity,                                                                                       
        maxFreeSockets: 256,                                                                                        
        maxCachedSessions: 100,                                                                                     
        _sessionCache: [Object] },                                                                                  
     socketPath: undefined,                                                                                         
     timeout: undefined,                                                                                            
     method: 'GET',                                                                                                 
     path: '/v1/user/following?user_id=1655331&restrict=public',                                                    
     _ended: true,                                                                                                  
     res:                                                                                                           
      IncomingMessage {                                                                                             
        _readableState: [ReadableState],                                                                            
        readable: false,                                                                                            
        _events: [Object],                                                                                          
        _eventsCount: 3,                                                                                            
        _maxListeners: undefined,                                                                                   
        socket: [TLSSocket],                                                                                        
        connection: [TLSSocket],                                                                                    
        httpVersionMajor: 1,                                                                                        
        httpVersionMinor: 1,                                                                                        
        httpVersion: '1.1',                                                                                         
        complete: true,                                                                                             
        headers: [Object],                                                                                          
        rawHeaders: [Array],                                                                                        
        trailers: {},                                                                                               
        rawTrailers: [],                                                                                            
        aborted: false,                                                                                             
        upgrade: false,                                                                                             
        url: '',                                                                                                    
        method: null,                                                                                               
        statusCode: 403,                                                                                            
        statusMessage: 'Forbidden',                                                                                 
        client: [TLSSocket],                                                                                        
        _consuming: false,                                                                                          
        _dumped: false,                                                                                             
        req: [Circular],                                                                                            
        responseUrl:                                                                                                
         'https://app-api.pixiv.net/v1/user/following?user_id=1655331&restrict=public',                             
        redirects: [] },                                                                                            
     aborted: false,                                                                                                
     timeoutCb: null,                                                                                               
     upgradeOrConnect: false,                                                                                       
     parser: null,                                                                                                  
     maxHeadersCount: null,                                                                                         
     _redirectable:                                                                                                 
      Writable {                                                                                                    
        _writableState: [WritableState],                                                                            
        writable: true,                                                                                             
        _events: [Object],                                                                                          
        _eventsCount: 2,                                                                                            
        _maxListeners: undefined,                                                                                   
        _options: [Object],                                                                                         
        _ended: true,                                                                                               
        _ending: true,                                                                                              
        _redirectCount: 0,                                                                                          
        _redirects: [],                                                                                             
        _requestBodyLength: 0,                                                                                      
        _requestBodyBuffers: [],                                                                                    
        _onNativeResponse: [Function],                                                                              
        _currentRequest: [Circular],                                                                                
        _currentUrl:                                                                                                
         'https://app-api.pixiv.net/v1/user/following?user_id=1655331&restrict=public' },                           
     [Symbol(isCorked)]: false,                                                                                     
     [Symbol(outHeadersKey)]:                                                                                       
      [Object: null prototype] {                                                                                    
        accept: [Array],                                                                                            
        authorization: [Array],                                                                                     
        'app-os': [Array],                                                                                          
        'app-os-version': [Array],                                                                                  
        'app-version': [Array],                                                                                     
        'user-agent': [Array],                                                                                      
        host: [Array] } },                                                                                          
  response:                                                                                                         
   { status: 403,                                                                                                   
     statusText: 'Forbidden',                                                                                       
     headers:                                                                                                       
      { server: 'nginx',                                                                                            
        date: 'Thu, 28 Mar 2019 19:36:05 GMT',                                                                      
        'content-type': 'application/json; charset=utf-8',                                                          
        'content-length': '90',                                                                                     
        connection: 'close',                                                                                        
        'x-userid': '21780164',                                                                                     
        vary: 'X-UserId',                                                                                           
        'x-content-type-options': 'nosniff',                                                                        
        'strict-transport-security': 'max-age=31536000' },                                                          
     config:                                                                                                        
      { adapter: [Function: httpAdapter],                                                                           
        transformRequest: [Object],                                                                                 
        transformResponse: [Object],                                                                                
        timeout: 0,                                                                                                 
        xsrfCookieName: 'XSRF-TOKEN',                                                                               
        xsrfHeaderName: 'X-XSRF-TOKEN',                                                                             
        maxContentLength: -1,                                                                                       
        validateStatus: [Function: validateStatus],                                                                 
        headers: [Object],                                                                                          
        method: 'get',                                                                                              
        baseURL: 'https://app-api.pixiv.net/',                                                                      
        url: 'https://app-api.pixiv.net/v1/user/following',                                                         
        params: [Object],                                                                                           
        data: undefined },                                                                                          
     request:                                                                                                       
      ClientRequest {                                                                                               
        _events: [Object],                                                                                          
        _eventsCount: 6,                                                                                            
        _maxListeners: undefined,                                                                                   
        outputData: [],                                                                                             
        outputSize: 0,                                                                                              
        writable: true,                                                                                             
        _last: true,                                                                                                
        chunkedEncoding: false,                                                                                     
        shouldKeepAlive: false,                                                                                     
        useChunkedEncodingByDefault: false,                                                                         
        sendDate: false,                                                                                            
        _removedConnection: false,                                                                                  
        _removedContLen: false,                                                                                     
        _removedTE: false,                                                                                          
        _contentLength: 0,                                                                                          
        _hasBody: true,                                                                                             
        _trailer: '',                                                                                               
        finished: true,                                                                                             
        _headerSent: true,                                                                                          
        socket: [TLSSocket],                                                                                        
        connection: [TLSSocket],                                                                                    
        _header:                                                                                                    
         'GET /v1/user/following?user_id=1655331&restrict=public HTTP/1.1\r\nAccept: application/json, text/plain, *
*\r\nAuthorization: Bearer ****************************\r\nApp-OS: ios\r\nApp-OS-Version: 9.3.3\r\nAp
-Version: 6.0.9\r\nUser-Agent: axios/0.18.0\r\nHost: app-api.pixiv.net\r\nConnection: close\r\n\r\n',               
        _onPendingData: [Function: noopPendingOutput],                                                              
        agent: [Agent],                                                                                             
        socketPath: undefined,                                                                                      
        timeout: undefined,                                                                                         
        method: 'GET',                                                                                              
        path: '/v1/user/following?user_id=1655331&restrict=public',                                                 
        _ended: true,                                                                                               
        res: [IncomingMessage],                                                                                     
        aborted: false,                                                                                             
        timeoutCb: null,                                                                                            
        upgradeOrConnect: false,                                                                                    
        parser: null,                                                                                               
        maxHeadersCount: null,                                                                                      
        _redirectable: [Writable],                                                                                  
        [Symbol(isCorked)]: false,                                                                                  
        [Symbol(outHeadersKey)]: [Object] },                                                                        
     data: { error: [Object] } } }                                                                                  
undefined                                                                                                           
root@8a393d977e7d:~/Pixiv-Downloader/bin# node test.js                                                              
{ userPreviews:                                                                                                     
   [ { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [], novels: [], isMuted: false },                                                   
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false },                                              
     { user: [Object], illusts: [Array], novels: [], isMuted: false } ],                                            
  nextUrl:                                                                                                          
   'https://app-api.pixiv.net/v1/user/following?user_id=1655331&restrict=public&offset=30' }                        

I replaced the token in request header, hope it doesn't matters.

Sorry for the long log, basically it tells that the same code run different results, one works normally and one don't. The two code are run sequentially. The second code is runned about 3~5 minutes after the first code done.

I have tried several times, but I can't get the pattern whether it works or not.

The only reason I can guess is it may limited the api requests (so I thinks it's Pixiv's problem), but I'm not sure about that.

What is the expected behavior?:

output partial user followings

Suggested solution:

Not a clue how this bug produces, sorry about that.

Auto translate tags

  • version:
  • node version: 14.11.0
  • npm (or yarn) version: 1.22.10

Do you want to request a feature or report a bug?: Request

What is the current behavior?:
You have to enter japanese tags to search for them.

What is the expected behavior?:
I wish tags would be automatically translated when searching for illusts. For example: When searching for "Genshin impact". It should automatically search for "原神"

Suggested solution:
I don't know how to implement this yet. I will update this thread when I find something. If anyone knows something that can help, please write it here ^^.

Error when using ES6 import

  • version:1.2.1
  • node version:20.1.0
  • npm (or yarn) version:pnpm 7.28

Do you want to request a feature or report a bug?:
I came across a bug.
What is the current behavior?:
I copied the example code and found that Icannot initialize the PixivApp instance. However, when I switched my current ES6 import method (import PixivAppApi from 'pixiv-app-api' ) to CommonJS module(const PixivAppApi =require('pixiv-app-api' )), it works.

The console log is:

 this.pixiv = new PixivAppApi(this.config.username as string, this.config.password as string, {
                     ^
TypeError: pixiv_app_api_1.default is not a constructor
    at new Pixiv (D:\work\michanDaily\src\services\puller\Pixiv\main.ts:30:22)
    at Object.<anonymous> (D:\work\michanDaily\src\app.ts:14:9)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module.m._compile (D:\work\michanDaily\node_modules\.pnpm\[email protected]_pilkwpwcmsgv4hfi6z42mdzm2m\node_modules\ts-node\src\index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
    at Object.require.extensions.<computed> [as .ts] (D:\work\michanDaily\node_modules\.pnpm\[email protected]_pilkwpwcmsgv4hfi6z42mdzm2m\node_modules\ts-node\src\index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1125:32)
    at Function.Module._load (node:internal/modules/cjs/loader:965:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at phase4 (D:\work\michanDaily\node_modules\.pnpm\[email protected]_pilkwpwcmsgv4hfi6z42mdzm2m\node_modules\ts-node\src\bin.ts:649:14)

What is the expected behavior?:
Using ES6 import works.
Suggested solution:
I've checked the source code and found no obvious error.

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.