anekos / Ank-Pixiv-Tool

An extension which supports one-click downloads of illustrations from Pixiv. It's able to choose automatically appropriate file names. It also supports full screen view of large illustrations on medium-sized screens.
135 stars 70 forks source link

ニコニコ静画でDL時にエラー #138

Closed kahusi closed 6 years ago

kahusi commented 6 years ago

表題の通り、適当なイラストをDLするとエラーが出て保存出来ません。 環境はFirefox55.0.3 (64ビット)、Windows7 Pro SP1 64bit エラーの内容は以下: <<ANK<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [TypeError] message: doc.querySelector(...) is null filename: chrome://ankpixiv/content/sites/anknicosei.js linenumber: 454 stack: getImageUrlAsync/<@chrome://ankpixiv/content/sites/anknicosei.js:454:21 TaskImpl_run@resource://gre/modules/Task.jsm:321:42 process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:922:23 walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:806:7 scheduleWalkerLoop/<@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:742:11

ginzu commented 6 years ago

これでどうでしょうか。 8cc724702a538a4b5e40e9bbd29c24197095abdc

kahusi commented 6 years ago

対応感謝します。 ただ、自分の環境では新版を入れられないので確認出来ておりません…… (一往 https://github.com/anekos/Ank-Pixiv-Tool/issues/132 は見てはいます)

ginzu commented 6 years ago

webextension版のニコ静モジュールを作ったのでよろしければ試してみてください https://github.com/anekos/Ank-Pixiv-Tool/commit/0e97cd878f9a7e1bd5a54e83b8d96950b58fc0e5

ただし無署名なのでfirefoxで動かすのは難しいかもしれません chromeで動かすのはさほど難しくないかもしれません

kahusi commented 6 years ago

webextension版、 https://developer.mozilla.org/ja/Add-ons/WebExtensions/Your_first_WebExtension を參考に入れてみた処、動作しました。 ファイル名の変更はソースを書き換える事になるのでしょうか。 (フォルダ自体はFirefox側にある「次のフォルダーに保存する」の設定で変えられましたが)

kahusi commented 6 years ago

あと、「情報取得中」や「保存済み」等の挿入テキストが文字化けしていました。

ginzu commented 6 years ago

firefoxで動かす場合はこちらの方がいいかもしれませんね https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext

ファイル名の変更は設定から変えられるはずですが ↑の中の「Keeping profile changes」をやらないとfirefoxの終了の度に設定が消えてしまうような気がします(未確認)

文字が化けてるのはfirefoxの問題と認識しているのでこちらで対応する予定はありません

その他旧版との動作の違いについては作業メモも読んでみてください https://github.com/anekos/Ank-Pixiv-Tool/blob/feature/webextensions/webextensions/misc/

ginzu commented 6 years ago

文字化けの件、回避方法を見つけたので修正しました。

また無署名だとweb-extで「Keeping profile changes」を使っても設定や履歴を維持できないことを確認しました。失礼しましたm( )m

unthinking commented 6 years ago

cyberfox 52.4.0にて動作確認しました。

ginzu commented 6 years ago

特に問題なさそうなのでcloseします。

ginzu commented 6 years ago

web-ext runでもダウンロード履歴を保持できることがわかりましたので追記します。

manifest.jsonに以下の様に applications.gecko.id を追加してください。

  "applications": {
    "gecko": {
      "id": "loot@vixip.kna",
      "strict_min_version": "55.0"
    }
  }

おまけで追加を行うスクリプトも作りました。

add_applications_gecko_id_to_manifest_json.py

ginzu commented 6 years ago

なぜweb-ext runにはidオプションがないのか…。

それはそれとして、AMO登録も済みましたのでcloseさせて頂きます。