mirror of
https://github.com/Ninedark9/PS4PackageLink.git
synced 2026-10-17 15:01:10 +02:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
008da08e08 | ||
|
|
8faf9b45c2 | ||
|
|
17eaaf490c | ||
|
|
34e3e63d72 | ||
|
|
8dd6b6b499 | ||
|
|
9dd4736517 |
No files matched your search
@@ -1,7 +1,7 @@
|
||||
name: Build Android APK v0.5.4
|
||||
on:
|
||||
push:
|
||||
branches: [android-build-v0.5.4]
|
||||
branches: [android-linkfix-v0.5.4]
|
||||
paths:
|
||||
- '.github/workflows/build-android.yml'
|
||||
- 'android-build.b64'
|
||||
@@ -39,6 +39,17 @@ jobs:
|
||||
base64 -d android-build.b64 > /tmp/source.zip
|
||||
mkdir -p android-project
|
||||
unzip -q /tmp/source.zip -d android-project
|
||||
- name: Verify JavaScript browser extractor syntax
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import re, pathlib
|
||||
p=pathlib.Path('android-project/app/src/main/java/dev/ninedark/ps4packagelink/catalog/BrowserLinkCapture.kt')
|
||||
text=p.read_text()
|
||||
match=re.search(r'const val javascript = """(.*?)"""',text,re.S)
|
||||
assert match,'Browser JavaScript not found'
|
||||
pathlib.Path('/tmp/host_discovery.js').write_text(match.group(1))
|
||||
PY
|
||||
node --check /tmp/host_discovery.js
|
||||
- name: Assemble debug APK
|
||||
working-directory: android-project
|
||||
run: bash ./gradlew --no-daemon testDebugUnitTest assembleDebug
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
name: Diagnose Host Pages
|
||||
on:
|
||||
push:
|
||||
branches: [android-linkfix-v0.5.4]
|
||||
paths: [.github/workflows/diagnose-hosts.yml]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
probe:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Render link widgets with real Chromium
|
||||
run: |
|
||||
python3 -m pip -q install selenium
|
||||
python3 - <<'PY'
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
import time
|
||||
opts=Options()
|
||||
opts.add_argument('--headless=new')
|
||||
opts.add_argument('--no-sandbox')
|
||||
opts.add_argument('--disable-dev-shm-usage')
|
||||
opts.add_argument('--window-size=1280,900')
|
||||
opts.add_argument('--disable-notifications')
|
||||
try:
|
||||
driver=webdriver.Chrome(options=opts)
|
||||
driver.set_page_load_timeout(28)
|
||||
driver.get('https://dlpsgame.com/resident-evil-2-ps4-pkg-3/')
|
||||
for pause in [3,5,8]:
|
||||
time.sleep(pause)
|
||||
print('AT',pause,'URL',driver.current_url,'TITLE',driver.title,flush=True)
|
||||
result=driver.execute_script('''var root=document.querySelector(".entry-content")||document.body;var a=Array.from(root.querySelectorAll("a[href]")); return {count:a.length, text:root.innerText.slice(0,2200), links:a.filter(x=>/download|mediafire|rootz|akia|let|data|1file|game/i.test(x.innerText+" "+x.href)).slice(0,28).map(x=>({text:x.innerText,href:x.href,target:x.target}))};''')
|
||||
print('RESULT',repr(result)[:6500],flush=True)
|
||||
driver.quit()
|
||||
except Exception as e: print('BROWSER_FAIL',type(e).__name__,str(e)[:500],flush=True)
|
||||
PY
|
||||
- name: Inspect genuine article links and contexts
|
||||
run: |
|
||||
python3 -m pip -q install beautifulsoup4
|
||||
python3 - <<'PY'
|
||||
import urllib.request, re
|
||||
from bs4 import BeautifulSoup
|
||||
urls=['https://dlpsgame.com/resident-evil-2-ps4-pkg-3/','https://downloadgameps3.net/archives/45302']
|
||||
for u in urls:
|
||||
print("URL",u,flush=True)
|
||||
try:
|
||||
req=urllib.request.Request(u,headers={'User-Agent':'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 Chrome/130 Safari/537.36'})
|
||||
with urllib.request.urlopen(req,timeout=20) as res:
|
||||
html=res.read(300000).decode('utf8','replace')
|
||||
print('RESULT',res.status,res.url,len(html),flush=True)
|
||||
soup=BeautifulSoup(html,'html.parser')
|
||||
for selector in ['article .entry-content','article','.entry-content','.post-content','main','div.post']:
|
||||
roots=soup.select(selector)
|
||||
print('ROOT',selector,len(roots),[len(x.select('a[href]')) for x in roots[:3]],flush=True)
|
||||
root=soup.select_one('article .entry-content, article .post-content, .entry-content, .post-content, main article, article, main') or soup.body
|
||||
print('SELECTED',str(root.get('class') if root else None),len(root.select('a[href]')) if root else 0,flush=True)
|
||||
for i,a in enumerate(root.select('a[href]')[:180]):
|
||||
h=a.get('href',''); t=a.get_text(' ',strip=True)[:55]
|
||||
if any(k in (h+' '+t).lower() for k in ['mediafire','rootz','akia','downloadgameps3','filecrypt','1file','game','update','dlc','link','mirror','rar','redirect']):
|
||||
print('ANCHOR',i,repr(t),repr(h[:145]),'target',a.get('target'),'outer',str(a.parent)[:230].replace('\n',' '),flush=True)
|
||||
print('TEXT_NEAR_DOWNLOAD',root.get_text(' ',strip=True)[-2600:],flush=True)
|
||||
except Exception as e: print('ERROR',repr(e),flush=True)
|
||||
PY
|
||||
+1146
-1090
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user