Skip to content

Commit be6f995

Browse files
committed
UPDATED
0 parents  commit be6f995

File tree

1,206 files changed

+140354
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,206 files changed

+140354
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 🐞 Application Issue Report
2+
description: Report a issue in CloudStream
3+
labels: [bug]
4+
body:
5+
6+
- type: textarea
7+
id: reproduce-steps
8+
attributes:
9+
label: Steps to reproduce
10+
description: Provide an example of the issue.
11+
placeholder: |
12+
Example:
13+
1. First step
14+
2. Second step
15+
3. Issue here
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: expected-behavior
21+
attributes:
22+
label: Expected behavior
23+
placeholder: |
24+
Example:
25+
"This should happen..."
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: actual-behavior
31+
attributes:
32+
label: Actual behavior
33+
placeholder: |
34+
Example:
35+
"This happened instead..."
36+
validations:
37+
required: true
38+
39+
- type: input
40+
id: cloudstream-version
41+
attributes:
42+
label: Cloudstream version and commit hash
43+
description: |
44+
You can find your Cloudstream version in **Settings**. Commit hash is the 7 character string next to the version.
45+
placeholder: |
46+
Example: "2.8.16 a49f466"
47+
validations:
48+
required: true
49+
50+
- type: input
51+
id: android-version
52+
attributes:
53+
label: Android version
54+
description: |
55+
You can find this somewhere in your Android settings.
56+
placeholder: |
57+
Example: "Android 12"
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
id: logcat
63+
attributes:
64+
label: Logcat
65+
placeholder: |
66+
To get logcat please go to Settings > Updates and backup > Show logcat 🐈.
67+
You can attach a file or link to some pastebin service if the file is too big.
68+
render: java
69+
70+
- type: textarea
71+
id: other-details
72+
attributes:
73+
label: Other details
74+
placeholder: |
75+
Additional details and attachments.
76+
77+
- type: checkboxes
78+
id: acknowledgements
79+
attributes:
80+
label: Acknowledgements
81+
description: Your issue will be closed if you haven't done these steps.
82+
options:
83+
- label: I am sure my issue is related to the app and **NOT some extension**.
84+
required: true
85+
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
86+
required: true
87+
- label: I have written a short but informative title.
88+
required: true
89+
- label: I have updated the app to pre-release version **[Latest](https://github.com/recloudstream/cloudstream/releases)**.
90+
required: true
91+
- label: I will fill out all of the requested information in this form.
92+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Request a new provider or report bug with an existing provider
4+
url: https://github.com/recloudstream
5+
about: EXTREMELY IMPORTANT - Please do not report any provider bugs here or request new providers. This repository does not contain any providers. Please find the appropriate repository and report your issue there or join the discord.
6+
- name: Discord
7+
url: https://discord.gg/5Hus6fM
8+
about: Join our discord for faster support on smaller issues.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ⭐ Feature request
2+
description: Suggest a feature to improve the app
3+
labels: [enhancement]
4+
body:
5+
6+
- type: textarea
7+
id: feature-description
8+
attributes:
9+
label: Describe your suggested feature
10+
description: How can an existing source be improved?
11+
placeholder: |
12+
Example:
13+
"It should work like this..."
14+
validations:
15+
required: true
16+
17+
- type: textarea
18+
id: other-details
19+
attributes:
20+
label: Other details
21+
placeholder: |
22+
Additional details and attachments.
23+
24+
- type: checkboxes
25+
id: acknowledgements
26+
attributes:
27+
label: Acknowledgements
28+
description: Your issue will be closed if you haven't done these steps.
29+
options:
30+
- label: My suggestion is **NOT** about adding a new provider
31+
required: true
32+
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
33+
required: true

.github/locales.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import re
2+
import glob
3+
import requests
4+
import lxml.etree as ET # builtin library doesn't preserve comments
5+
6+
7+
SETTINGS_PATH = "app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt"
8+
START_MARKER = "/* begin language list */"
9+
END_MARKER = "/* end language list */"
10+
XML_NAME = "app/src/main/res/values-b+"
11+
ISO_MAP_URL = "https://raw.githubusercontent.com/haliaeetus/iso-639/master/data/iso_639-1.min.json"
12+
INDENT = " "*4
13+
14+
iso_map = requests.get(ISO_MAP_URL, timeout=300).json()
15+
16+
# Load settings file
17+
src = open(SETTINGS_PATH, "r", encoding='utf-8').read()
18+
before_src, rest = src.split(START_MARKER)
19+
rest, after_src = rest.split(END_MARKER)
20+
21+
# Load already added langs
22+
languages = {}
23+
for lang in re.finditer(r'Pair\("(.*)", "(.*)"\)', rest):
24+
name, iso = lang.groups()
25+
languages[iso] = name
26+
27+
# Add not yet added langs
28+
for folder in glob.glob(f"{XML_NAME}*"):
29+
iso = folder[len(XML_NAME):].replace("+", "-")
30+
if iso not in languages.keys():
31+
entry = iso_map.get(iso.lower(), {'nativeName':iso}) # fallback to iso code if not found
32+
languages[iso] = entry['nativeName'].split(',')[0] # first name if there are multiple
33+
34+
# Create pairs
35+
pairs = []
36+
for iso in sorted(languages, key=lambda iso: languages[iso].lower()): # sort by language name
37+
name = languages[iso]
38+
pairs.append(f'{INDENT}Pair("{name}", "{iso}"),')
39+
40+
# Update settings file
41+
open(SETTINGS_PATH, "w+",encoding='utf-8').write(
42+
before_src +
43+
START_MARKER +
44+
"\n" +
45+
"\n".join(pairs) +
46+
"\n" +
47+
END_MARKER +
48+
after_src
49+
)
50+
51+
# Go through each values.xml file and fix escaped \@string
52+
for file in glob.glob(f"{XML_NAME}*/strings.xml"):
53+
try:
54+
tree = ET.parse(file)
55+
for child in tree.getroot():
56+
if not child.text:
57+
continue
58+
if child.text.startswith("\\@string/"):
59+
print(f"[{file}] fixing {child.attrib['name']}")
60+
child.text = child.text.replace("\\@string/", "@string/")
61+
with open(file, 'wb') as fp:
62+
fp.write(b'<?xml version="1.0" encoding="utf-8"?>\n')
63+
tree.write(fp, encoding="utf-8", method="xml", pretty_print=True, xml_declaration=False)
64+
except ET.ParseError as ex:
65+
print(f"[{file}] {ex}")
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Archive build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- '*.md'
8+
- '*.json'
9+
- '**/wcokey.txt'
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: "Archive-build"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Generate access token
21+
id: generate_token
22+
uses: tibdex/github-app-token@v2
23+
with:
24+
app_id: ${{ secrets.GH_APP_ID }}
25+
private_key: ${{ secrets.GH_APP_KEY }}
26+
repository: "recloudstream/secrets"
27+
28+
- name: Generate access token (archive)
29+
id: generate_archive_token
30+
uses: tibdex/github-app-token@v2
31+
with:
32+
app_id: ${{ secrets.GH_APP_ID }}
33+
private_key: ${{ secrets.GH_APP_KEY }}
34+
repository: "recloudstream/cloudstream-archive"
35+
36+
- uses: actions/checkout@v6
37+
38+
- name: Set up JDK 17
39+
uses: actions/setup-java@v5
40+
with:
41+
distribution: temurin
42+
java-version: 17
43+
44+
- name: Grant execute permission for gradlew
45+
run: chmod +x gradlew
46+
47+
- name: Fetch keystore
48+
id: fetch_keystore
49+
run: |
50+
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore
51+
mkdir -p "${TMP_KEYSTORE_FILE_PATH}"
52+
curl -H "Authorization: token ${{ steps.generate_token.outputs.token }}" -o "${TMP_KEYSTORE_FILE_PATH}/prerelease_keystore.keystore" "https://raw.githubusercontent.com/recloudstream/secrets/master/keystore.jks"
53+
curl -H "Authorization: token ${{ steps.generate_token.outputs.token }}" -o "keystore_password.txt" "https://raw.githubusercontent.com/recloudstream/secrets/master/keystore_password.txt"
54+
KEY_PWD="$(cat keystore_password.txt)"
55+
echo "::add-mask::${KEY_PWD}"
56+
echo "key_pwd=$KEY_PWD" >> $GITHUB_OUTPUT
57+
58+
- name: Setup Gradle
59+
uses: gradle/actions/setup-gradle@v5
60+
with:
61+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
62+
63+
- name: Run Gradle
64+
run: ./gradlew assemblePrerelease
65+
env:
66+
SIGNING_KEY_ALIAS: "key0"
67+
SIGNING_KEY_PASSWORD: ${{ steps.fetch_keystore.outputs.key_pwd }}
68+
SIGNING_STORE_PASSWORD: ${{ steps.fetch_keystore.outputs.key_pwd }}
69+
SIMKL_CLIENT_ID: ${{ secrets.SIMKL_CLIENT_ID }}
70+
SIMKL_CLIENT_SECRET: ${{ secrets.SIMKL_CLIENT_SECRET }}
71+
72+
- uses: actions/checkout@v6
73+
with:
74+
repository: "recloudstream/cloudstream-archive"
75+
token: ${{ steps.generate_archive_token.outputs.token }}
76+
path: "archive"
77+
78+
- name: Move build
79+
run: cp app/build/outputs/apk/prerelease/release/*.apk "archive/$(git rev-parse --short HEAD).apk"
80+
81+
- name: Push archive
82+
run: |
83+
cd $GITHUB_WORKSPACE/archive
84+
git config --local user.email "[email protected]"
85+
git config --local user.name "GitHub Actions"
86+
git add .
87+
git commit --amend -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
88+
git push --force
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Dokka
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- '*.md'
8+
9+
concurrency:
10+
group: "dokka"
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Generate access token
18+
id: generate_token
19+
uses: tibdex/github-app-token@v2
20+
with:
21+
app_id: ${{ secrets.GH_APP_ID }}
22+
private_key: ${{ secrets.GH_APP_KEY }}
23+
repository: "recloudstream/dokka"
24+
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
with:
28+
path: "src"
29+
30+
- name: Checkout dokka
31+
uses: actions/checkout@v6
32+
with:
33+
repository: "recloudstream/dokka"
34+
path: "dokka"
35+
token: ${{ steps.generate_token.outputs.token }}
36+
37+
- name: Clean old builds
38+
run: |
39+
cd $GITHUB_WORKSPACE/dokka/
40+
rm -rf "./app"
41+
rm -rf "./library"
42+
43+
- name: Set up JDK 17
44+
uses: actions/setup-java@v5
45+
with:
46+
distribution: temurin
47+
java-version: 17
48+
49+
- name: Setup Gradle
50+
uses: gradle/actions/setup-gradle@v5
51+
with:
52+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
53+
54+
- name: Set up Android SDK
55+
uses: android-actions/setup-android@v3
56+
57+
- name: Generate Dokka
58+
run: |
59+
cd $GITHUB_WORKSPACE/src/
60+
chmod +x gradlew
61+
./gradlew docs:dokkaGeneratePublicationHtml
62+
63+
- name: Copy Dokka
64+
run: cp -r $GITHUB_WORKSPACE/src/docs/build/dokka/html/* $GITHUB_WORKSPACE/dokka/
65+
66+
- name: Push builds
67+
run: |
68+
cd $GITHUB_WORKSPACE/dokka
69+
touch .nojekyll
70+
git config --local user.email "111277985+recloudstream[bot]@users.noreply.github.com"
71+
git config --local user.name "recloudstream[bot]"
72+
git add .
73+
git commit --amend -m "Generate dokka for recloudstream/cloudstream@${GITHUB_SHA}" || exit 0 # do not error if nothing to commit
74+
git push --force

0 commit comments

Comments
 (0)