diff --git a/data/xpath.json b/data/xpath.json index 683a997..17299f8 100644 --- a/data/xpath.json +++ b/data/xpath.json @@ -8,10 +8,8 @@ "IS_EXPENDEDABLE_EXPENDED_BUTTON": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer/ytd-guide-entry-renderer", "THREE_LINES": "//yt-icon-button[@id='guide-button']", "DRAWER_OPENED": "//div[@id='contentContainer' and @opened]", - "ALREADY_SUBSCRIBE": "//span[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{{channelID}}']/ancestor::div[@id='info-section']//div[@id='notification-preference-button' and not(@invisible)]//span[text()='Subscribed']", - "SUBSCRIBE_BTN": "//span[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{{channelID}}']/ancestor::div[@id='info-section']//div[@id='subscribe-button']//span[text()='Subscribe']/ancestor::button", + "ALREADY_SUBSCRIBE": "//div[@id='inner-header-container']//div[@id='notification-preference-button' and not(@invisible)]//span[text()='Subscribed']", + "SUBSCRIBE_BTN": "//div[@id='inner-header-container']/div/div[@id='subscribe-button']//yt-button-shape[not(@hidden) and @id='subscribe-button-shape']/button", "UNSUB1": "//yt-formatted-string[text()='Unsubscribe']", - "UNSUB2": "//button[@aria-label='Unsubscribe']", - "SEARCH_INPUT": "//input[@id='search']", - "NAVIGATION_PROGRESS": "//yt-page-navigation-progress[not(@hidden)]" + "UNSUB2": "//button[@aria-label='Unsubscribe']" } diff --git a/data/xpaths/v1.6.json b/data/xpaths/v1.6.json new file mode 100644 index 0000000..683a997 --- /dev/null +++ b/data/xpaths/v1.6.json @@ -0,0 +1,17 @@ +{ + "SUBSCRIPTIONS_SECTION": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']", + "GET_CHANNELS_WITHOUT_EXPEND": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-entry-renderer/a[@href]", + "SUB_CHANNELS_EXPENDED_ITEMS": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer/div/div/ytd-guide-entry-renderer", + "GET_CHANNELS_IN_EXPEND": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer/div/div/ytd-guide-entry-renderer/a[@href]", + "IS_EXPENDEDABLE": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer", + "IS_EXPENDEDABLE_EXPENDED": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer[@expanded]", + "IS_EXPENDEDABLE_EXPENDED_BUTTON": "//*[contains(normalize-space(), 'Subscriptions')]/following-sibling::div[@id='items']/ytd-guide-collapsible-entry-renderer/ytd-guide-entry-renderer", + "THREE_LINES": "//yt-icon-button[@id='guide-button']", + "DRAWER_OPENED": "//div[@id='contentContainer' and @opened]", + "ALREADY_SUBSCRIBE": "//span[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{{channelID}}']/ancestor::div[@id='info-section']//div[@id='notification-preference-button' and not(@invisible)]//span[text()='Subscribed']", + "SUBSCRIBE_BTN": "//span[translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{{channelID}}']/ancestor::div[@id='info-section']//div[@id='subscribe-button']//span[text()='Subscribe']/ancestor::button", + "UNSUB1": "//yt-formatted-string[text()='Unsubscribe']", + "UNSUB2": "//button[@aria-label='Unsubscribe']", + "SEARCH_INPUT": "//input[@id='search']", + "NAVIGATION_PROGRESS": "//yt-page-navigation-progress[not(@hidden)]" +} diff --git a/manifest.json b/manifest.json index 7045cd6..b8995ef 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Youtube Subscriptions Transfer", "description": "Transferring subscriptions from one YouTube account to another", - "version": "1.5", + "version": "1.6", "manifest_version": 3, "icons": { "16": "src/assets/icons/icon16.png", diff --git a/package.json b/package.json index 134d173..c54b03a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "youtube-subscriptions-transfer", - "version": "1.5", + "version": "1.6", "type": "module", "repository": { "type": "git", diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 9a720ec..95fa900 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,11 +1,10 @@ export const STORIES_URL = ["https://www.youtube.com/"]; export const DEFAULT_STATUS_MSG = "Ready for request"; export const APP_NAME = "Youtube Subscriptions Transfer"; -export const VERSION = "v1.5"; +export const VERSION = "v1.6"; export const REPO_URL = "https://github.com/biplobsd/yst"; -export const XPATH_URL = - "https://raw.githubusercontent.com/biplobsd/yst/main/data/xpath.json"; +export const XPATH_URL = `https://raw.githubusercontent.com/biplobsd/yst/main/data/xpaths/${VERSION}.json`; export const CHANNEL_PATHS_KEY = "channelPaths"; export const XPATH_VALUES_KEY = "xpathValues"; diff --git a/src/utils/xpaths.ts b/src/utils/xpaths.ts index 285a387..acf69ea 100644 --- a/src/utils/xpaths.ts +++ b/src/utils/xpaths.ts @@ -1,4 +1,4 @@ -import xpathJson from "../../data/xpath.json"; +import xpathJson from "../../data/xpaths/v1.6.json"; import { z } from "zod"; export const XPathModelSchema = z.object({