fix(frontend): Strip tracking info from URLs
This commit is contained in:
committed by
Dhanush R
parent
f40d1e4b27
commit
c1db7babdd
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
if (input_url.includes("/story/")) {
|
if (input_url.includes("/story/")) {
|
||||||
// https://wattpad.com/story/237369078-wattpad-books-presents
|
// https://wattpad.com/story/237369078-wattpad-books-presents
|
||||||
input_url = input_url.split("-")[0].split("/story/")[1]; // removes tracking fields and title
|
input_url = input_url.split("-")[0].split("?")[0].split("/story/")[1]; // removes tracking fields and title
|
||||||
download_id = input_url;
|
download_id = input_url;
|
||||||
mode = "story";
|
mode = "story";
|
||||||
} else if (input_url.includes("/stories/")) {
|
} else if (input_url.includes("/stories/")) {
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
mode = "story";
|
mode = "story";
|
||||||
} else {
|
} else {
|
||||||
// https://www.wattpad.com/939051741-wattpad-books-presents-the-qb-bad-boy-and-me
|
// https://www.wattpad.com/939051741-wattpad-books-presents-the-qb-bad-boy-and-me
|
||||||
input_url = input_url.split("-")[0].split("wattpad.com/")[1]; // removes tracking fields and title
|
input_url = input_url.split("-")[0].split("?")[0].split("wattpad.com/")[1]; // removes tracking fields and title
|
||||||
download_id = input_url;
|
download_id = input_url;
|
||||||
if (/^\d+$/.test(download_id)) {
|
if (/^\d+$/.test(download_id)) {
|
||||||
// If "wattpad.com/{download_id}" contains only numbers
|
// If "wattpad.com/{download_id}" contains only numbers
|
||||||
|
|||||||
Reference in New Issue
Block a user