File tree Expand file tree Collapse file tree 3 files changed +68
-3
lines changed
Expand file tree Collapse file tree 3 files changed +68
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' V*.*.*'
7+
8+ jobs :
9+ build-and-publish :
10+ runs-on : ubuntu-22.04
11+ permissions :
12+ contents : read
13+ id-token : write # needed for trusted publishing
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ' 3.11'
23+
24+ - name : Install build tools
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install build
28+
29+ - name : Build package
30+ run : python -m build
31+
32+ - name : Publish to PyPI
33+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 22from bs4 import BeautifulSoup
33import re
44import os
5+ import sys
56import time
67from pathlib import Path
78from urllib .parse import quote_plus
@@ -303,10 +304,17 @@ def main():
303304 mirror_choice = input ("Enter choice (1 or 2): " ).strip ()
304305 mirror_pref = "Germany" if mirror_choice == '2' else "USA"
305306
306- # Initialize scraper
307-
307+ # First, determine the correct path
308+ if getattr (sys , 'frozen' , False ):
309+ # Running as compiled executable
310+ download_dir = os .path .dirname (sys .executable )
311+ else :
312+ # Running as script
313+ download_dir = os .path .dirname (os .path .abspath (__file__ ))
314+
315+ # pass the resulting variable to the function
308316 scraper = AFHScraper (
309- download_dir = os . path . dirname ( os . path . abspath ( __file__ )) ,
317+ download_dir = download_dir ,
310318 mirror_preference = mirror_pref
311319 )
312320
Original file line number Diff line number Diff line change 1+ [build-system ]
2+ requires = [" setuptools>=69.0.0" , " wheel>=0.43.0" ]
3+ build-backend = " setuptools.build_meta"
4+
5+ [project ]
6+ name = " AndroidFileHostScraper"
7+ version = " 1.0.1"
8+ description = " A simple AndroidFileHost scraper for fetching links and metadata."
9+ readme = " README.md"
10+ license = { text = " Apache-2.0" }
11+ authors = [
12+ { name = " fl0w" , email = " fl0w_dev@protonmail.com" }
13+ ]
14+ requires-python = " >=3.8"
15+ dependencies = [
16+ " requests>=2.31.0" ,
17+ " beautifulsoup4>=4.12.3"
18+ ]
19+
20+ [project .urls ]
21+ Homepage = " https://github.com/codefl0w/AndroidFileHostScraper"
22+ Repository = " https://github.com/codefl0w/AndroidFileHostScraper"
23+ Issues = " https://github.com/codefl0w/AndroidFileHostScraper/issues"
24+ Donate = " https://buymeacoffee.com/fl0w"
You can’t perform that action at this time.
0 commit comments