diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json new file mode 100644 index 0000000..fec15c0 --- /dev/null +++ b/app/_locales/ja/messages.json @@ -0,0 +1,62 @@ +{ + "appName": { + "message": "YouTube Auto Like", + "description": "アプリの名前" + }, + "appDesc": { + "message":"自動的に任意のYouTube動画を高評価ボタンを押します。", + "description": "アプリの説明" + }, + "appDescDetail": { + "message": "この拡張機能は、登録しているチャンネルの動画を視聴するたびに高評価を押します。また、視聴した動画全てを高評価する事もできます。お気軽に新しい機能を提案、ご貢献ください:", + "description": "Webストアについての概要" + }, + "optLikeSub": { + "message": "登録したチャンネルのみ高評価する" + }, + "optLikeAll": { + "message": "全ての動画に高評価する" + }, + "optLikeNone": { + "message": "無効" + }, + "optLikeInstant": { + "message": "超スピードで高評価" + }, + "optLikeCustom": { + "message": "タイミングを指定" + }, + "optLikePercentage": { + "message": "割合" + }, + "optLikeMinutes": { + "message": "分" + }, + "optLikeRandom": { + "message": "ランダムなタイミング" + }, + "optUseList": { + "message": "リストの使用" + }, + "optBlackList": { + "message": "ブラックリスト" + }, + "optWhiteList": { + "message": "ホワイトリスト" + }, + "optWhiteListWarning": { + "message": "⚠️ リストが空の場合、高評価はされません" + }, + "linkDonate": { + "message": "寄付!" + }, + "linkContribute": { + "message": "貢献!" + }, + "mngName": { + "message": "チャンネルの名前" + }, + "mngURL": { + "message": "チャンネルのURL" + } +} diff --git a/app/manifest.json b/app/manifest.json index 0e1f39a..82bdfb2 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,6 +1,6 @@ { "name": "__MSG_appName__", - "version": "3.6.1", + "version": "3.6.2", "manifest_version": 2, "description": "__MSG_appDesc__", "icons": { diff --git a/app/scripts/modules/liker-paper.js b/app/scripts/modules/liker-paper.js index 9f7fd73..5cd2c7c 100644 --- a/app/scripts/modules/liker-paper.js +++ b/app/scripts/modules/liker-paper.js @@ -290,7 +290,17 @@ class PaperLiker { * the current video's channel */ isUserSubscribed() { - return document.querySelector("ytd-subscribe-button-renderer button.yt-spec-button-shape-next--tonal") !== null; + let subscribeButtons = document.querySelectorAll("ytd-subscribe-button-renderer :not(*[hidden]) button.yt-spec-button-shape-next--tonal") + // the ':not(*[hidden]) ytd-subscribe-button-renderer :not(*[hidden]) button.yt-spec-button-shape-next--tonal' + // does not work, thus use isHidden + let buttonExist = subscribeButtons.length > 0 + log("sub button exist: ", buttonExist) + if (!buttonExist) return false + + let subscribeButton = Array.from(subscribeButtons).find(isNotHidden) + log("sub button not hidden: ", subscribeButton) + return subscribeButton !== undefined; + } shouldLike() { @@ -301,7 +311,7 @@ class PaperLiker { return false; } - let mode_should_like = ""; + let mode_should_like = false; if (this.options.like_what === "subscribed") { log("Sub mode"); mode_should_like = this.isUserSubscribed(); diff --git a/app/scripts/modules/miscellaneous.js b/app/scripts/modules/miscellaneous.js index 703178c..6684a7b 100644 --- a/app/scripts/modules/miscellaneous.js +++ b/app/scripts/modules/miscellaneous.js @@ -94,3 +94,18 @@ async function isInList(creator) { console.log("isInList return", in_list) return in_list; } + +function isHidden(node) { + // if reach root html + if (node === document) return false; + + if (node.hasAttribute("hidden")) { + return true; + } else { + return isHidden(node.parentNode); + } +} + +function isNotHidden(node){ + return !isHidden(node); +} \ No newline at end of file diff --git a/app/update_info.html b/app/update_info.html index e01dffd..71a73af 100644 --- a/app/update_info.html +++ b/app/update_info.html @@ -15,6 +15,7 @@

YouTube Auto Like

Feel free to report any bug on Github.