Skip to content

Commit

Permalink
Merge pull request #76 from Taknok/dev
Browse files Browse the repository at this point in the history
3.6.2
  • Loading branch information
Taknok authored Feb 6, 2023
2 parents 08fbdd7 + 48b2da7 commit cdb00c1
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 3 deletions.
62 changes: 62 additions & 0 deletions app/_locales/ja/messages.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_appName__",
"version": "3.6.1",
"version": "3.6.2",
"manifest_version": 2,
"description": "__MSG_appDesc__",
"icons": {
Expand Down
14 changes: 12 additions & 2 deletions app/scripts/modules/liker-paper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
Expand Down
15 changes: 15 additions & 0 deletions app/scripts/modules/miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions app/update_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h1 id="title"><strong>YouTube</strong> Auto Like</h1>
<ul>
<li>Update to new Youtube layout. Thank you <a href="https://github.com/Taknok/youtube-auto-like/issues/68"> NexusDarkshade</a> !</li>
<li>Fix changes after new Youtube layout. Thank you <a href="https://github.com/Taknok/youtube-auto-like/issues/72"> JoelleEmmily & Fraeksn (and also Divin1ty666 & ReiNasc)</a> !</li>
<li>Fix changes in Youtube layout. Thank you <a href="https://github.com/Taknok/youtube-auto-like/issues/74"> LittleVulpix, JinkerJinx & NexusDarkshade</a> !</li>
</ul>
<p>Feel free to report any bug on <a id="report-link" href="https://github.com/Taknok/youtube-auto-like">Github</a>.</p>
<div id="links">
Expand Down

0 comments on commit cdb00c1

Please sign in to comment.