kacapower commited on
Commit
613ff6c
·
verified ·
1 Parent(s): 8e5fe2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -2
app.py CHANGED
@@ -70,7 +70,22 @@ def generate_blogger_html(app_query, custom_link, mirror_1, mirror_2, mod_featur
70
  reviews_count = app_details.get('ratings', 1000)
71
  category = app_details.get('genre', 'Utility')
72
  developer = app_details.get('developer', 'Unknown Developer')
73
- installs = app_details.get('installs', '10,000+')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  version = app_details.get('version', 'Varies with device')
75
  recent_changes = app_details.get('recentChanges', '')
76
 
@@ -109,10 +124,12 @@ def generate_blogger_html(app_query, custom_link, mirror_1, mirror_2, mod_featur
109
 
110
  root_color = "#10b981" if "No" in root_req else "#ef4444"
111
 
 
112
  # Schemas
113
  schema_app = {"@context": "https://schema.org", "@type": "SoftwareApplication", "name": title, "operatingSystem": "ANDROID", "applicationCategory": category, "image": icon_url, "aggregateRating": {"@type": "AggregateRating", "ratingValue": str(rating), "ratingCount": str(reviews_count)}}
114
  schema_faq = {"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": f"Is {title} Mod safe?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, verified by Lexical Space."}}]}
115
- schema_script = f'<script type="application/ld+json">\n[{json.dumps(schema_app)}, {json.dumps(schema_faq)}]\n</script>'
 
116
 
117
  # THE FINAL HTML
118
  html_template = f"""
@@ -138,6 +155,7 @@ def generate_blogger_html(app_query, custom_link, mirror_1, mirror_2, mod_featur
138
  <a href="{custom_link}" target="_blank" rel="nofollow noopener" style="flex: 2; min-width: 260px; max-width: 400px; background: {theme_color}; color: #fff; text-decoration: none; padding: 14px 20px; border-radius: 50px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 25px {theme_color}80; transition: transform 0.3s ease;"><i class="fa-solid fa-cloud-arrow-down"></i> Download APK</a>
139
  {mirror1_html}
140
  {mirror2_html}
 
141
  </div>
142
  {vt_html}
143
 
 
70
  reviews_count = app_details.get('ratings', 1000)
71
  category = app_details.get('genre', 'Utility')
72
  developer = app_details.get('developer', 'Unknown Developer')
73
+ # --- INSTALL FORMATTER (10,000,000,000+ to 10B+) ---
74
+ raw_installs = app_details.get('installs', '10,000+')
75
+ clean_num = raw_installs.replace(',', '').replace('+', '')
76
+ if clean_num.isdigit():
77
+ num = int(clean_num)
78
+ if num >= 1_000_000_000:
79
+ installs = f"{num // 1_000_000_000}B+"
80
+ elif num >= 1_000_000:
81
+ installs = f"{num // 1_000_000}M+"
82
+ elif num >= 1_000:
83
+ installs = f"{num // 1_000}K+"
84
+ else:
85
+ installs = f"{num}+"
86
+ else:
87
+ installs = raw_installs
88
+ # ---------------------------------------------------
89
  version = app_details.get('version', 'Varies with device')
90
  recent_changes = app_details.get('recentChanges', '')
91
 
 
124
 
125
  root_color = "#10b981" if "No" in root_req else "#ef4444"
126
 
127
+ # Schemas
128
  # Schemas
129
  schema_app = {"@context": "https://schema.org", "@type": "SoftwareApplication", "name": title, "operatingSystem": "ANDROID", "applicationCategory": category, "image": icon_url, "aggregateRating": {"@type": "AggregateRating", "ratingValue": str(rating), "ratingCount": str(reviews_count)}}
130
  schema_faq = {"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": f"Is {title} Mod safe?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, verified by Lexical Space."}}]}
131
+ schema_sysreq = {"@context": "https://schema.org", "@type": "SoftwareApplication", "name": title, "operatingSystem": "ANDROID", "applicationCategory": category, "author": { "@type": "Organization", "name": developer }, "requirements": { "@type": "SoftwareApplicationRequirements", "name": "Minimum System Requirements", "operatingSystem": "Android 9.0 (Pie)+", "ram": "4 GB+", "storage": "100 MB+" }}
132
+ schema_script = f'<script type="application/ld+json">\n[{json.dumps(schema_app)}, {json.dumps(schema_faq)}, {json.dumps(schema_sysreq)}]\n</script>'
133
 
134
  # THE FINAL HTML
135
  html_template = f"""
 
155
  <a href="{custom_link}" target="_blank" rel="nofollow noopener" style="flex: 2; min-width: 260px; max-width: 400px; background: {theme_color}; color: #fff; text-decoration: none; padding: 14px 20px; border-radius: 50px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 25px {theme_color}80; transition: transform 0.3s ease;"><i class="fa-solid fa-cloud-arrow-down"></i> Download APK</a>
156
  {mirror1_html}
157
  {mirror2_html}
158
+ <a href="https://play.google.com/store/apps/details?id={app_id}" target="_blank" rel="nofollow noopener" style="flex: 2; min-width: 260px; max-width: 400px; background: #10b981; color: #fff; text-decoration: none; padding: 14px 20px; border-radius: 50px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 0 25px rgba(16, 185, 129, 0.4); transition: transform 0.3s ease;"><i class="fa-brands fa-google-play"></i> Play Store</a>
159
  </div>
160
  {vt_html}
161