🎉 New website!

This commit is contained in:
taskylizard
2023-11-12 22:12:57 +05:30
parent 28f602b9ad
commit c97a0abf92
68 changed files with 8433 additions and 353 deletions

View File

@@ -1,32 +1,32 @@
import os
headersData = {
"AdblockVPNGuide.md": [":name_badge:", "140", "# Adblocking / Privacy", "Adblocking, Privacy, VPN's, Proxies, Antivirus"],
"AI.md": [":robot_face:", "130", "# Artificial Intelligence", "Chat Bots, Text Generators, Image Generators, ChatGPT Tools"],
"Android-iOSGuide.md": [":iphone:", "45", "# Android / iOS", "Apps, Jailbreaking, Android Emulators"],
"AudioPiracyGuide.md": [":musical_note:", "110", "# Music / Podcasts / Radio", "Stream Audio, Download Audio, Torrent Audio"],
"Beginners-Guide.md": [":pirate_flag:", "150", "# Beginners Guide to Piracy", ""],
"DEVTools.md": [":male-technologist:", "50", "# Developer Tools", ""],
"DownloadPiracyGuide.md": [":floppy_disk:", "80", "# Downloading", "Download Sites, Software Sites, Open Directories"],
"EDUPiracyGuide.md": [":brain:", "60", "# Educational", "Courses, Documentaries, Learning Resources"],
"GamingPiracyGuide.md": [":video_game:", "100", "# Gaming / Emulation", "Download Games, ROMs, Gaming Tools"],
"LinuxGuide.md": [":penguin:", "40", "# Linux / MacOS", "Apps, Software Sites, Gaming"],
"MISCGuide.md": [":open_file_folder:", "30", "# Miscellaneous", "Extensions, Indexes, News, Health, Food, Fun"],
"NSFWPiracy.md": [":underage:", "25", "# NSFW", ""],
"Non-English.md": [":earth_asia:", "35", "# Non-English", "International Piracy Sites"],
"ReadingPiracyGuide.md": [":green_book:", "90", "# Books / Comics / Manga", "Books, Comics, Magazines, Newspapers"],
"STORAGE.md": [":card_file_box:", "1", "", ""],
"TOOLSGuide.md": [":wrench:", "58", "# Tools", "General Tools, Internet Tools, System Tools"],
"TorrentPiracyGuide.md": [":cyclone:", "70", "# Torrenting", "Torrent Clients, Torrent Sites, Trackers"],
"VideoPiracyGuide.md": [":tv:", "120", "# Movies / TV / Anime", "Stream Videos, Download Videos, Torrent Videos"],
"base64.md": [":key:", "20", "", ""],
"img-tools.md": [":camera:", "55", "# Image Tools", ""],
"UnsafeSites.md": [":warning:", "21", "# Unsafe Sites", ""]
"AdblockVPNGuide.md": ["Adblocking / Privacy", "Adblocking, Privacy, VPN's, Proxies, Antivirus"],
"AI.md": ["Artificial Intelligence", "Chat Bots, Text Generators, Image Generators, ChatGPT Tools"],
"Android-iOSGuide.md": ["Android / iOS", "Apps, Jailbreaking, Android Emulators"],
"AudioPiracyGuide.md": ["Music / Podcasts / Radio", "Stream Audio, Download Audio, Torrent Audio"],
"Beginners-Guide.md": ["Beginners Guide", "A Guide for Beginners to Piracy"],
"DEVTools.md": ["Developer Tools", "Git, Hosting, App Dev, Software Dev"],
"DownloadPiracyGuide.md": ["Downloading", "Download Sites, Software Sites, Open Directories"],
"EDUPiracyGuide.md": ["Educational", "Courses, Documentaries, Learning Resources"],
"GamingPiracyGuide.md": ["Gaming / Emulation", "Download Games, ROMs, Gaming Tools"],
"LinuxGuide.md": ["Linux / MacOS", "Apps, Software Sites, Gaming"],
"MISCGuide.md": ["Miscellaneous", "Extensions, Indexes, News, Health, Food, Fun"],
"NSFWPiracy.md": ["NSFW", "NSFW Indexes, Streaming, Downloading"],
"Non-English.md": ["Non-English", "International Piracy Sites"],
"ReadingPiracyGuide.md": ["Books / Comics / Manga", "Books, Comics, Magazines, Newspapers"],
"STORAGE.md": ["Storage", "Index for everything in the wiki."],
"TOOLSGuide.md": ["Tools", "General Tools, Internet Tools, System Tools"],
"TorrentPiracyGuide.md": ["Torrenting", "Torrent Clients, Torrent Sites, Trackers"],
"VideoPiracyGuide.md": ["Movies / TV / Anime", "Stream Videos, Download Videos, Torrent Videos"],
"base64.md": ["Base64", "Base64 storage"],
"img-tools.md": ["Image Tools", "Image Editors, Generators, Compress"],
"UnsafeSites.md": ["Unsafe Sites", "Unsafe/harmful sites to avoid."]
}
def getHeaderForPage(pageFilename):
data = headersData[pageFilename]
header = '---\n' + 'icon: ' + '"' + data[0] + '"' + '\n' + 'order: ' + data[1] + '\n' + '---\n' + data[2] + '\n' + data[3] + '\n\n'
header = '---\n' + 'title: ' + '"' + data[0] + '"' + '\n' + 'description: ' + data[1] + '\n' + '---\n' + '# ' + data[0] + '\n' + data[1] + '\n\n'
return header
def apply_to_all_md_files_in_current_dir():
@@ -36,7 +36,6 @@ def apply_to_all_md_files_in_current_dir():
with open(file, 'r', encoding='utf-8') as f:
content = f.read()
if not content.startswith('---'):
print("adding header to " + file)
with open(file, 'w', encoding='utf-8') as f2:
header = getHeaderForPage(file)
f2.write(header+content)

View File

@@ -1,23 +0,0 @@
---
image: /static/banner4.png
icon: ":wave:"
---
# Welcome
![](/static/banner4.png)
**The Largest Collection of Free Stuff On The Internet!**
* Anyone can suggest [changes or corrections](https://rentry.org/fmhyedit) to the wiki. Please read our [Contribution Guide](https://rentry.co/Contrib-Guide) before trying to add or remove anything.
* If you're adding a new site, please [search](https://raw.githubusercontent.com/nbats/FMHYedit/main/single-page) first to make sure we don't already have it.
* Approved edits will be applied to this site and all [🔒 backups](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/backups).
* You can send us stuff directly via [💬 Discord](https://redd.it/17f8msf).
* You can also checkout our subreddit, [r/FREEMEDIAHECKYEAH](https://www.reddit.com/r/FREEMEDIAHECKYEAH/) to know about any major updates to the wiki.
***
Emoji Legend:
* 🌐 - 3rd Party Indexes
* ↪️ - Storage Page Links
* ⭐ - Community Recommendations

View File

@@ -1,33 +0,0 @@
input: .
output: .retype
url: fmhy.pages.dev
branding:
logo: /static/fmhy.ico
logoDark: /static/fmhy.ico
title: FMHY
favicon: /static/favicon.ico
links: # Top bar. Icons from FontAwesome 6.4.2.
- text: Discord
link: https://redd.it/17f8msf
icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m3,0C1.35,0,0,1.35,0,3v13.5c0,1.65,1.35,3,3,3h4.5v3.75c0,.29.16.54.41.67.25.13.56.1.79-.07l5.8-4.35h6.5c1.65,0,3-1.35,3-3V3c0-1.65-1.35-3-3-3H3Z"/></svg>
- text: Search
link: https://fmhy-search.streamlit.app/
icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m19.5,9.75c0,2.15-.7,4.14-1.88,5.75l5.93,5.94c.59.59.59,1.54,0,2.12-.59.59-1.54.59-2.12,0l-5.93-5.94c-1.61,1.18-3.6,1.87-5.75,1.87C4.36,19.5,0,15.13,0,9.75S4.36,0,9.75,0s9.75,4.36,9.75,9.75Zm-9.75,6.75c3.73,0,6.75-3.02,6.75-6.75s-3.02-6.75-6.75-6.75-6.75,3.02-6.75,6.75,3.02,6.75,6.75,6.75Z"/></svg>
- text: Reddit
link: https://www.reddit.com/r/FREEMEDIAHECKYEAH/
icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m9.36,14.4c-.67,0-1.2-.54-1.2-1.19s.54-1.2,1.2-1.2,1.19.54,1.19,1.2-.54,1.19-1.19,1.19Zm14.64-2.4c0,6.63-5.37,12-12,12S0,18.63,0,12,5.37,0,12,0s12,5.37,12,12Zm-6.4-1.99c-.45,0-.86.19-1.15.48-1.08-.75-2.55-1.23-4.17-1.29l.84-3.79,2.68.6c0,.66.54,1.19,1.19,1.19s1.2-.55,1.2-1.2-.54-1.2-1.2-1.2c-.47,0-.87.28-1.07.67l-2.96-.66c-.15-.04-.3.07-.33.21l-.92,4.18c-1.61.07-3.05.55-4.14,1.3-.3-.31-.71-.49-1.17-.49-1.69,0-2.24,2.27-.7,3.04-.05.24-.08.49-.08.75,0,2.55,2.86,4.61,6.39,4.61s6.4-2.06,6.4-4.61c0-.26-.03-.52-.09-.76,1.51-.77.96-3.02-.72-3.02Zm-3.33,5.62c-.88.88-3.68.87-4.53,0-.11-.11-.3-.11-.4,0-.12.12-.12.31,0,.42,1.1,1.1,4.22,1.1,5.33,0,.12-.11.12-.3,0-.42-.11-.11-.3-.11-.4,0Zm.37-3.63c-.66,0-1.19.54-1.19,1.2s.54,1.19,1.19,1.19,1.2-.54,1.2-1.19-.53-1.2-1.2-1.2Z"/></svg>
- text: Github
link: https://github.com/fmhy
icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 496 512"><path d="m8.03,19.32c0,.1-.11.18-.25.18-.16.01-.27-.06-.27-.18,0-.1.11-.18.25-.18.15-.01.27.06.27.18Zm-1.5-.22c-.03.1.06.21.21.24.13.05.27,0,.3-.1s-.06-.21-.21-.26c-.13-.03-.27.01-.3.11Zm2.14-.08c-.14.03-.24.13-.22.24.01.1.14.16.29.13.14-.03.24-.13.22-.23-.01-.09-.15-.16-.29-.14ZM11.85,0C5.13,0,0,5.23,0,12.11c0,5.5,3.38,10.21,8.2,11.87.62.11.84-.28.84-.6s-.01-2-.01-3.05c0,0-3.39.74-4.1-1.48,0,0-.55-1.44-1.35-1.82,0,0-1.11-.78.08-.76,0,0,1.2.1,1.87,1.28,1.06,1.92,2.84,1.36,3.53,1.04.11-.79.43-1.34.77-1.67-2.7-.31-5.43-.71-5.43-5.48,0-1.36.37-2.05,1.14-2.92-.13-.32-.54-1.65.13-3.37,1.01-.32,3.34,1.34,3.34,1.34.97-.28,2.01-.42,3.04-.42s2.07.14,3.04.42c0,0,2.33-1.67,3.34-1.34.66,1.72.25,3.05.13,3.37.77.88,1.25,1.56,1.25,2.92,0,4.79-2.85,5.17-5.55,5.48.45.39.82,1.14.82,2.3,0,1.67-.01,3.74-.01,4.15,0,.32.22.71.84.6,4.84-1.65,8.12-6.36,8.12-11.86C24,5.23,18.56,0,11.85,0Zm-7.14,17.12c-.06.05-.05.16.03.26.08.08.19.11.25.05.06-.05.05-.16-.03-.26-.08-.08-.19-.11-.25-.05Zm-.52-.4c-.03.06.01.14.11.19.08.05.17.03.21-.03.03-.06-.01-.14-.11-.19-.1-.03-.17-.01-.21.03Zm1.57,1.77c-.08.06-.05.21.06.31.11.11.25.13.31.05.06-.06.03-.21-.06-.31-.11-.11-.25-.13-.31-.05Zm-.55-.73c-.08.05-.08.18,0,.29s.21.16.27.11c.08-.06.08-.19,0-.31-.07-.11-.19-.16-.27-.1Z"/></svg>
- text: Updates
link: https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/updates/
icon: log
- text: Backups
link: https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/backups
icon: shield-lock
footer:
copyright: ""
meta:
title: " | FreeMediaHeckYeah"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -1,193 +0,0 @@
import re
import os
import sys
def replaces_for_beginners_guide(text):
text = re.sub('\[TOC\]\n', '', text, flags=re.MULTILINE)
text = re.sub('\*\*Table of Contents\*\*\n\[TOC2\]\n', '', text, flags=re.MULTILINE)
text = re.sub('# -> \*\*\*Beginners Guide to Piracy\*\*\* <-\n', '', text, flags=re.MULTILINE)
text = re.sub(r"!!!note\s(.+?)\n", r"!!!\n\1\n!!!\n", text, flags=re.MULTILINE)
text = re.sub(r"!!!info\s(.+?)\n", r"!!!\n\1\n!!!\n", text, flags=re.MULTILINE)
text = re.sub(r"!!!warning\s(.+?)\n", r"!!!warning\n\1\n!!!\n", text, flags=re.MULTILINE)
text = re.sub(r">\s(.+?)\n", r"> \1\n\n", text, flags=re.MULTILINE)
text = re.sub('\*\*\[\^ Back to Top\]\(#beginners-guide-to-piracy\)\*\*', '', text, flags=re.MULTILINE)
text = re.sub("!!!\n!!!\n", "!!!\n", text, flags=re.MULTILINE)
text = re.sub("\n\*\*\[", "\n* **[", text, flags=re.MULTILINE)
return text
def do_some_individual_replaces(text):
#special cases of link not replaced correctly
text = re.sub('.pages.dev/storage/#encode--decode_urls', '.pages.dev/storage/#encode--decode-urls', text)
text = re.sub('.pages.dev/base64/#do-k-ument', '.pages.dev/base64/#do_k_ument', text)
text = re.sub('.pages.dev/devtools/#machine-learning2', '.pages.dev/devtools/#machine-learning-1', text)
#Base64-decoder script link
text = re.sub('\*\* site or extension\.\n', '** site or extension\.\nAlternatively, install this [userscript](https://rentry.co/wc7s2/raw)\n', text, flags=re.MULTILINE)
return text
def change_some_general_formatting(text):
text = re.sub('\*\*\*\n\n', '', text, flags=re.MULTILINE)
text = re.sub('\*\*\*\n', '', text, flags=re.MULTILINE)
text = re.sub('# ►', '##', text)
text = re.sub('## ▷', '###', text)
text = re.sub('####', '###', text)
text = re.sub(r'^\*\*Note\*\* - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE)
text = re.sub(r'^\* \*\*Note\*\* - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE)
text = re.sub(r'^Note - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE)
text = re.sub(r'^\*\*Warning\*\* - (.+)$', r'!!!warning\n\1\n!!!', text, flags=re.MULTILINE)
return text
def remove_backtowiki_and_toc(text):
text = re.sub('\*\*\[◄◄ Back to Wiki Index\]\(https://www\.reddit\.com/r/FREEMEDIAHECKYEAH/wiki/index\)\*\*\n', '', text, flags=re.MULTILINE)
text = re.sub(r'\*\*\[Table of Contents\]\(https?:\/\/.*?ibb\.co.*\)\*\* - For mobile users\n', '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\* \n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\n\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
return text
def replace_domain_and_page(text):
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/ai', 'fmhy.pages.dev/ai', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/adblock-vpn-privacy', 'fmhy.pages.dev/adblockvpnguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/android', 'fmhy.pages.dev/android-iosguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/video', 'fmhy.pages.dev/videopiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/audio', 'fmhy.pages.dev/audiopiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/games', 'fmhy.pages.dev/gamingpiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/reading', 'fmhy.pages.dev/readingpiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/download', 'fmhy.pages.dev/downloadpiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/torrent', 'fmhy.pages.dev/torrentpiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/edu', 'fmhy.pages.dev/edupiracyguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/tools-misc', 'fmhy.pages.dev/toolsguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/linux', 'fmhy.pages.dev/linuxguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/non-eng', 'fmhy.pages.dev/non-english', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/misc', 'fmhy.pages.dev/miscguide', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage', 'fmhy.pages.dev/storage', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/dev-tools', 'fmhy.pages.dev/devtools', text)
text = re.sub('www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/img-tools', 'fmhy.pages.dev/img-tools', text)
text = re.sub('github.com/nbats/FMHYedit/blob/main/base64.md#', 'fmhy.pages.dev/base64/#', text)
return text
def replace_underscore_in_subsections(text):
pattern = r'(/#[\w\-]+(?:_[\w]+)*)'
matches = re.findall(pattern, text)
for match in matches:
replacement = match.replace('_', '-')
text = text.replace(match, replacement)
return text
def reformat_subsections(text):
text = re.sub('/#wiki_', '/#', text)
text = re.sub('#wiki_', '/#', text)
text = re.sub('.25BA_', '', text)
text = re.sub('.25B7_', '', text)
text = re.sub('_.2F_', '--', text)
text = replace_underscore_in_subsections(text)
return text
def replace_urls_in_links_to_FMHY_wiki(text):
text = remove_backtowiki_and_toc(text)
text = replace_domain_and_page(text)
text = reformat_subsections(text)
text = change_some_general_formatting(text)
text = do_some_individual_replaces(text)
return text
def apply_replace_to_all_md_files_in_current_dir():
files = os.listdir('.')
for file in files:
if file.endswith('.md'):
with open(file, 'r', encoding='utf-8') as f:
content = f.read()
content = replace_urls_in_links_to_FMHY_wiki(content)
if file == "Beginners-Guide.md":
content = replaces_for_beginners_guide(content)
with open(file, 'w', encoding='utf-8') as f2:
f2.write(content)
def print_info_for_confirmation():
print("This script is about to replace URLs in all .md files in the current directory: " + os.getcwd())
print("The affected files will be the following:")
files = os.listdir('.')
for file in files:
if file.endswith('.md'):
print(file)
# TESTER
testText = """
aaaaaaaa (https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage#wiki_telegram_audio_download) aaaaaaa
**[◄◄ Back to Wiki Index](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/index)**
* ⭐ **[YouTube Music Clients](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage#wiki_youtube_music_players)**
Soundtracks](https://github.com/nbats/FMHYedit/blob/main/base64.md#damons-game-soundtracks)**, [Squ
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage#wiki_game_libraries_.2F_launcher)
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/games#wiki_.25BA_tracking_.2F_discovery)
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/linux#wiki_.25BA_linux_adblock_.2F_privacy)
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/video#wiki_.25BA_download_sites)
[sdfasdf](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/android#wiki_.25B7_android_podcasts_.2F_radio)gwrgewrgew
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/android#wiki_.25B7_android_relaxation)
adfads awerfaw (https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage#wiki_music_libraries_.2F_players)
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/edu/#wiki_.25BA_downloading) aaaaaaaaa
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/adblock-vpn-privacy#wiki_.25B7_adblocking_extensions)
* [link](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/torrent) - ...sdvs
https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/img-tools#wiki_.25B7_painting_.2F_drawing
* ⭐ **[AI Indexes](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/ai#wiki_.25BA_ai_indexes)** - Artificial Intelligence Indexes
(https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/adblock-vpn-privacy#wiki_.25BA_vpn)
https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage/#wiki_open_directory_search_string_builder
https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/tools-misc#wiki_.25B7_file_tools
~~~~~~
***
***
**[◄◄ Back to Wiki Index](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/index)**
***
***
**[Table of Contents](https://i.imgur.com/whYmImm.png)** - For mobile users
***
***
~~~~~~
argaseg ae this is legit test between stuff to remove1
***
# ► with ##
## ▷ with ###
#### with ###
* **Note** - Some aggregators still include TPB, so it's best to avoid using them for software and games.
**Warning** - Misuse of Chat Archivers, Deleters, Mods & 3rd Party Clients is against Discords TOS, so use them at your own risk.
**[movie-web](https://movie-web.app/) / [FMovies](https://fmovies.name/) / [Soap2Day](https://soapgate.org/)** - Fast streaming
**[Zoro](https://zoro.to/) / [9Anime](https://www.9anime.to/)** - Fast anime streaming
"""
def just_test_the_replacer_function():
print("---TEST---")
print("This is how the resulting edited links would look like:")
print( replace_urls_in_links_to_FMHY_wiki(testText) )
print("---END OF TEST---\n\n\n")
just_test_the_replacer_function()
# MAIN EXECUTION
print("---MAIN SCRIPT---")
print_info_for_confirmation()
apply_replace_to_all_md_files_in_current_dir()
print("---END OF MAIN SCRIPT---")

116
.github/replace.py vendored Normal file
View File

@@ -0,0 +1,116 @@
import re
import os
import sys
def replaces_for_beginners_guide(text):
text = re.sub('\[TOC\]\n', '', text, flags=re.MULTILINE)
text = re.sub('\*\*Table of Contents\*\*\n\[TOC2\]\n', '', text, flags=re.MULTILINE)
text = re.sub('# -> \*\*\*Beginners Guide to Piracy\*\*\* <-\n', '', text, flags=re.MULTILINE)
text = re.sub(r"!!!note\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE)
text = re.sub(r"!!!info\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE)
text = re.sub(r"!!!warning\s(.+?)\n", r":::warning\n\1\n:::\n", text, flags=re.MULTILINE)
text = re.sub(r">\s(.+?)\n", r"> \1\n\n", text, flags=re.MULTILINE)
text = re.sub('\*\*\[\^ Back to Top\]\(#beginners-guide-to-piracy\)\*\*', '', text, flags=re.MULTILINE)
text = re.sub(r"!!!\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE)
text = re.sub("\n\*\*\[", "\n* **[", text, flags=re.MULTILINE)
text = re.sub(r'>(.*)\n\n(.*)', r':::details \1\n\2\n:::', text, flags=re.MULTILINE)
return text
def do_some_individual_replaces(text):
#special cases of link not replaced correctly
text = re.sub('/storage/#encode--decode_urls', '/storage/#encode--decode-urls', text)
text = re.sub('/base64/#do-k-ument', '/base64/#do_k_ument', text)
text = re.sub('/devtools/#machine-learning2', '/devtools/#machine-learning-1', text)
#Base64-decoder script link
text = re.sub('(.+?) site or extension\.\n', 'Click on the texts to copy them decoded.\n', text, flags=re.MULTILINE)
return text
def change_some_general_formatting(text):
text = re.sub('\*\*\*\n\n', '', text, flags=re.MULTILINE)
text = re.sub('\*\*\*\n', '', text, flags=re.MULTILINE)
text = re.sub('# ►', '##', text)
text = re.sub('## ▷', '###', text)
text = re.sub('####', '###', text)
text = re.sub(r'^\*\*Note\*\* - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE)
text = re.sub(r'^\* \*\*Note\*\* - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE)
text = re.sub(r'^Note - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE)
text = re.sub(r'^\*\*Warning\*\* - (.+)$', r':::warning\n\1\n:::', text, flags=re.MULTILINE)
text = re.sub(r'^\*\s([^*])', "- \\1", text, 0, re.MULTILINE)
return text
def remove_backtowiki_and_toc(text):
text = re.sub('\*\*\[◄◄ Back to Wiki Index\]\(https://www\.reddit\.com/r/FREEMEDIAHECKYEAH/wiki/index\)\*\*\n', '', text, flags=re.MULTILINE)
text = re.sub(r'\*\*\[Table of Contents\]\(https?:\/\/.*?ibb\.co.*\)\*\* - For mobile users\n', '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\* \n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\*\*\*\n\*\*\*\n\n\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
text = re.sub("\*\*\*\n\*\*\*\n\n\n\*\*\*\n\n", '', text, flags=re.MULTILINE)
return text
def replace_domain_and_page(text):
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/ai', '/ai', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/adblock-vpn-privacy', '/adblockvpnguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/android', '/android-iosguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/video', '/videopiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/audio', '/audiopiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/games', '/gamingpiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/reading', '/readingpiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/download', '/downloadpiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/torrent', '/torrentpiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/edu', '/edupiracyguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/tools-misc', '/toolsguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/linux', '/linuxguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/non-eng', '/non-english', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/misc', '/miscguide', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/storage', '/storage', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/dev-tools', '/devtools', text)
text = re.sub('https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/img-tools', '/img-tools', text)
text = re.sub('https://github.com/nbats/FMHYedit/blob/main/base64.md#', '/base64/#', text)
return text
def replace_underscore_in_subsections(text):
pattern = r'(/#[\w\-]+(?:_[\w]+)*)'
matches = re.findall(pattern, text)
for match in matches:
replacement = match.replace('_', '-')
text = text.replace(match, replacement)
return text
def reformat_subsections(text):
text = re.sub('/#wiki_', '/#', text)
text = re.sub('#wiki_', '/#', text)
text = re.sub('.25BA_', '', text)
text = re.sub('.25B7_', '', text)
text = re.sub('_.2F_', '--', text)
text = replace_underscore_in_subsections(text)
return text
def replace_urls_in_links_to_FMHY_wiki(text):
text = remove_backtowiki_and_toc(text)
text = replace_domain_and_page(text)
text = reformat_subsections(text)
text = change_some_general_formatting(text)
text = do_some_individual_replaces(text)
return text
def apply_replace_to_all_md_files_in_current_dir():
files = os.listdir('.')
for file in files:
if file.endswith('.md'):
with open(file, 'r', encoding='utf-8') as f:
content = f.read()
content = replace_urls_in_links_to_FMHY_wiki(content)
if file == "Beginners-Guide.md":
content = replaces_for_beginners_guide(content)
with open(file, 'w', encoding='utf-8') as f2:
f2.write(content)
apply_replace_to_all_md_files_in_current_dir()

7
.github/script.sh vendored Normal file
View File

@@ -0,0 +1,7 @@
python .github/add-headers.py
python .github/replace.py
for file in *; do
[[ -f "$file" ]] && mv "$file" "${file,,}" 2>/dev/null
done
exit 0

43
.github/workflows/deploy-api.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Deploy API
on:
push:
branches:
- main
- vitepress
pull_request:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
ci:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 6
- uses: pnpm/action-setup@v2.4.0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- run: pnpm install --no-frozen-lockfile
- name: Build
run: pnpm api:build
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
NITRO_PRESET: cloudflare
- name: Publish to Cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
vars: WEBHOOK_URL
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}

View File

@@ -1,40 +0,0 @@
name: Update FMHY Retype
on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *'
jobs:
update:
name: Update FMHY Retype
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Move Files
run: |
cp -r .github/assets/* .
shell: bash
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Prepare Files
shell: bash
run: |
python .github/replace-links-to-fmhy-in-files-in-current-dir.py
python .github/add-headers.py
- name: Build Retype
uses: retypeapp/action-build@latest
- uses: retypeapp/action-github-pages@latest
with:
branch: retype
update-branch: true

View File

@@ -3,7 +3,7 @@ name: Update Single Page
on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *'
- cron: "0 */2 * * *"
jobs:
update:
@@ -19,7 +19,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
- name: Configure Git
run: |