Skip to content

Commit 1af9b0c

Browse files
Add .ignore file to temp directory to prevent indexing by Jellyfin (Arrowar#435)
1 parent 493e80e commit 1af9b0c

File tree

3 files changed

+57
-24
lines changed

3 files changed

+57
-24
lines changed

.github/.domain/domains.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"cb01new": {
3-
"domain": "cam",
4-
"full_url": "https://cb01net.cam/",
5-
"old_domain": "monster",
6-
"time_change": "2025-11-11 07:20:50"
3+
"domain": "cfd",
4+
"full_url": "https://cb01net.cfd/",
5+
"old_domain": "cam",
6+
"time_change": "2025-11-17 20:18:19"
77
},
88
"animeunity": {
99
"domain": "so",
@@ -18,10 +18,10 @@
1818
"time_change": "2025-03-21 12:20:27"
1919
},
2020
"guardaserie": {
21-
"domain": "wiki",
22-
"full_url": "https://guardaserietv.wiki/",
23-
"old_domain": "xyz",
24-
"time_change": "2025-11-10 18:30:49"
21+
"domain": "wtf",
22+
"full_url": "https://guardaserietv.wtf/",
23+
"old_domain": "wiki",
24+
"time_change": "2025-11-17 19:12:03"
2525
},
2626
"streamingwatch": {
2727
"domain": "org",
@@ -30,21 +30,21 @@
3030
"time_change": "2025-04-29 12:30:30"
3131
},
3232
"altadefinizione": {
33-
"domain": "news",
34-
"full_url": "https://altadefinizionegratis.news/",
35-
"old_domain": "ist",
36-
"time_change": "2025-11-11 15:23:05"
33+
"domain": "shop",
34+
"full_url": "https://altadefinizionegratis.shop/",
35+
"old_domain": "news",
36+
"time_change": "2025-11-18 07:15:43"
3737
},
3838
"streamingcommunity": {
39-
"domain": "center",
40-
"full_url": "https://streamingcommunityz.center/",
41-
"old_domain": "casa",
42-
"time_change": "2025-11-10 17:19:26"
39+
"domain": "dk",
40+
"full_url": "https://streamingcommunityz.dk/",
41+
"old_domain": "bet",
42+
"time_change": "2025-11-17 16:21:15"
4343
},
4444
"altadefinizionegratis": {
45-
"domain": "news",
46-
"full_url": "https://altadefinizionegratis.news/",
47-
"old_domain": "ist",
48-
"time_change": "2025-11-11 15:23:08"
45+
"domain": "shop",
46+
"full_url": "https://altadefinizionegratis.shop/",
47+
"old_domain": "news",
48+
"time_change": "2025-11-18 07:15:44"
4949
}
5050
}

StreamingCommunity/Api/Site/streamingcommunity/site.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,45 @@ def title_search(query: str) -> int:
7979

8080
for i, dict_title in enumerate(data):
8181
try:
82+
images = dict_title.get('images') or []
83+
filename = None
84+
preferred_types = ['poster', 'cover', 'cover_mobile', 'background']
85+
for ptype in preferred_types:
86+
for img in images:
87+
if img.get('type') == ptype and img.get('filename'):
88+
filename = img.get('filename')
89+
break
90+
91+
if filename:
92+
break
93+
94+
if not filename and images:
95+
filename = images[0].get('filename')
96+
97+
image_url = None
98+
if filename:
99+
image_url = f"{site_constant.FULL_URL.replace('stream', 'cdn.stream')}/images/{filename}"
100+
101+
# Extract date: prefer last_air_date, otherwise try translations (last_air_date or release_date)
102+
date = dict_title.get('last_air_date')
103+
if not date:
104+
for trans in dict_title.get('translations') or []:
105+
if trans.get('key') in ('last_air_date', 'release_date') and trans.get('value'):
106+
date = trans.get('value')
107+
break
108+
82109
media_search_manager.add_media({
83110
'id': dict_title.get('id'),
84111
'slug': dict_title.get('slug'),
85112
'name': dict_title.get('name'),
86113
'type': dict_title.get('type'),
87-
'date': dict_title.get('last_air_date'),
88-
'image': f"{site_constant.FULL_URL.replace('stream', 'cdn.stream')}/images/{dict_title.get('images')[0].get('filename')}"
114+
'date': date,
115+
'image': image_url
89116
})
90117

91118
if site_constant.TELEGRAM_BOT:
92-
choice_text = f"{i} - {dict_title.get('name')} ({dict_title.get('type')}) - {dict_title.get('last_air_date')}"
119+
choice_date = date if date else "N/A"
120+
choice_text = f"{i} - {dict_title.get('name')} ({dict_title.get('type')}) - {choice_date}"
93121
choices.append(choice_text)
94122

95123
except Exception as e:

StreamingCommunity/Lib/Downloader/HLS/downloader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ def setup_directories(self):
101101
os.makedirs(self.temp_dir, exist_ok=True)
102102
for subdir in ['video', 'audio', 'subs']:
103103
os.makedirs(os.path.join(self.temp_dir, subdir), exist_ok=True)
104+
105+
# Create a .ignore file to prevent temp directory from being indexed by Jellyfin
106+
ignore_path = os.path.join(self.temp_dir, '.ignore')
107+
with open(ignore_path, 'a', encoding='utf-8'):
108+
os.utime(ignore_path, None)
104109

105110
def move_final_file(self, final_file: str):
106111
"""Moves the final merged file to the desired output location."""
@@ -716,4 +721,4 @@ def get_progress_data(self) -> Optional[Dict]:
716721

717722
except Exception as e:
718723
logging.error(f"Error getting progress data: {e}")
719-
return None
724+
return None

0 commit comments

Comments
 (0)