It is currently April 27th, 2024, 7:42 pm



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Randomize Filename To Keep Original Name in URL.
PostPosted: December 4th, 2023, 12:31 am 

Joined: March 30th, 2015, 12:31 pm
Posts: 670
i using randomize filename when upload. but when URL generate can we use any kind of replacement that TC will use original file name for URL?

lets say release name is "spiderman.s1e01"


like current TC out URL:

Rapidgator
https://rapidgator.net/file/98699y.rar

using replacement
https://rapidgator.net/file/spiderman.s1e01.rar

reason is: rapidgator has some banned word which is why using random file name.
and need replacement so that we can use themaleecher replacement url


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename
PostPosted: December 4th, 2023, 7:22 pm 
Site Admin
User avatar

Joined: March 10th, 2011, 11:14 pm
Posts: 12646
Location: Earth
Try this message replacement from next update (2.86).

It won't work in current version.

Search for:
Code:
(https?://rapidgator.net/file/.+?)/.+?(\.part[0-9]+\.rar|\.rar)


Replace with:
Code:
$$1/{#fileUploadName#}$2


Enable regex search.

_________________
themaPoster | themaCreator | themaManager | themaLeecher | themaRegister


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 5th, 2023, 1:20 am 

Joined: March 30th, 2015, 12:31 pm
Posts: 670
currently it's wokring with <postSubject> tag themaposter and themamanager.


but file name can be

Code:
ABC.part1.rar
ABC.rar


so here is the regex, in case if someone need.
Code:
(https?://rapidgator.net/file/[a-z0-9]+/)[^/]+(\.part\d\.rar|\.rar)


replace with
Code:
$1<postSubject>$2


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 5th, 2023, 10:23 am 
Site Admin
User avatar

Joined: March 10th, 2011, 11:14 pm
Posts: 12646
Location: Earth
Would not really recommend using <postSubject>.

It can have invalid characters for URL.

I have updated replacement above to include "part" as well.

_________________
themaPoster | themaCreator | themaManager | themaLeecher | themaRegister


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 5th, 2023, 11:51 am 

Joined: March 30th, 2015, 12:31 pm
Posts: 670
ermm we are use releasename as archive, shouldn't be it's fine?

i was thinking to replace the file name which are already posted used themamanager.


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 5th, 2023, 4:27 pm 
Site Admin
User avatar

Joined: March 10th, 2011, 11:14 pm
Posts: 12646
Location: Earth
In your case it should be fine, other people might have very different subject (even replacements added to subject which would add bad characters for URL).

If anyone else needs this the better way is like I wrote from next update.

_________________
themaPoster | themaCreator | themaManager | themaLeecher | themaRegister


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 6th, 2023, 12:55 am 

Joined: March 30th, 2015, 12:31 pm
Posts: 670
can you please give me an example how that can be the problem? i actually have many posts which already posted on site that I am considering replacing the filename for the URL using TM.


Top
 Profile  
Reply with quote  
 Post subject: Re: Randomize Filename To Keep Original Name in URL.
PostPosted: December 6th, 2023, 5:43 am 
Site Admin
User avatar

Joined: March 10th, 2011, 11:14 pm
Posts: 12646
Location: Earth
If the subject has backslashes "/" the URL would because invalid.

If it has normal spaces " " it would also break at the wrong point and won't be fully clickable.

The "+" might be bad as well.

Those are probably most common.

_________________
themaPoster | themaCreator | themaManager | themaLeecher | themaRegister


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Theme designed by stylerbb.net © 2008
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All times are UTC