[SOLVED]Modify the address of the links?

Off-topic posts of interest to the "Everything" community.
Post Reply
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

[SOLVED]Modify the address of the links?

Post by Debugger »

website.com/muzyka/hands-up/213149-rihanna-feat-david-guetta-whos-that-chick-yu-vs-ctm-remix.html
website.com/muzyka/hands-up/214549-dune-amp-loona-turn-the-tide-g4bby-feat-bazz-boyz-remix-edit.html


Red color - delete.
Each other links have the same character.


website\.com/muzyka/hands-up/[0-9]*

Replace with:...?
Last edited by Debugger on Sat Apr 06, 2019 12:36 pm, edited 1 time in total.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Modify the address of the links?

Post by therube »

Bookmarklets or "Greasemonkey", but the means are beyond me.

(There other greasemonkey like extensions. Names escape me. Escape me even more so in Firefox Quantum. Didn't even realize that "GreaseMonkey" was still around. It was like some time back, something happened ?, & people switch from greasemonkey to ???. And what the state of these extensions - in Quantum, I'm not familiar.)



Sample bookmarklet, "remove redirects":

Code: Select all

javascript:(function(){var%20k,x,t,i,j,p;%20for(k=0;x=document.links[k];k++){t=x.href.replace(/[%]3A/ig,':').replace(/[%]2f/ig,'/');i=t.lastIndexOf('http');if(i>0){%20t=t.substring(i);%20j=t.indexOf('&');%20if(j>0)t=t.substring(0,j);%20p=/https?\:\/\/[^\s]*[^.,;'">\s\)\]]/.exec(unescape(t));%20if(p)%20x.href=p[0];%20}%20else%20if%20(x.onmouseover&&x.onmouseout){x.onmouseover();%20if%20(window.status%20&&%20window.status.indexOf('://')!=-1)x.href=window.status;%20x.onmouseout();%20}%20x.onmouseover=null;%20x.onmouseout=null;%20}})();
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Modify the address of the links?

Post by Debugger »

What redirection are you talking about?
Here, only need to change the address.
I thought to change - to , and separate in cells.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Modify the address of the links?

Post by therube »

What that would do is to turn:

Code: Select all

http://trapazoid.com/?http://musik.com/get_file/1/a15d992ec199c21cae63123ff82d16c2c5df0b0f5f/18130_720p.mp4
into

Code: Select all

http://musik.com/get_file/1/a15d992ec199c21cae63123ff82d16c2c5df0b0f5f/18130_720p.mp4
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Modify the address of the links?

Post by therube »

Are you talking about from within your web browser or in your text editor?
If the latter, maybe something like this:

(.*?[0-9]+)(-.*)
\1

Everything, non-greedy, up to a sequence (1 minimum) of digit(s), excluding everything after a following dash.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Modify the address of the links?

Post by Debugger »

therube - Regular expression meet expectations. Thanks a lot. ;)
Post Reply