Skip to content

Commit b754a6a

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

File tree

3 files changed

+41
-8
lines changed

3 files changed

+41
-8
lines changed

.github/.domain/domains.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"time_change": "2025-11-11 15:23:05"
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": {
4545
"domain": "news",

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)