I have a problem. I can't figure out a way to do this so I'm asking for someone to help.
I have URL like below:
https://abc.xyz/f/b/go_cc_Jpterxvid_avi_mp4
And, I want to remove the last part of URL and change /f/ with /d/ so that I can get the URL to be like below:
https://abc.xyz/d/b
Keep in mind the prefix /b
. It changes regular python.
I have tried this below based on url answer but it didsn't work for me.
newurl = oldurl.replace('/f/','/d/').rsplit("/", 1)[0])