update rss_proxy.py
* removed print
This commit is contained in:
@@ -1,29 +1,18 @@
|
|||||||
workflow:
|
workflow:
|
||||||
rules:
|
rules:
|
||||||
- changes:
|
- changes:
|
||||||
- proxy/**
|
- proxy/**/*
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- requirements.txt
|
- requirements.txt
|
||||||
when: always
|
when: always
|
||||||
- when: never
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- push
|
- push
|
||||||
|
|
||||||
# test:
|
|
||||||
# stage: test
|
|
||||||
# image: python:3.11-alpine
|
|
||||||
# script:
|
|
||||||
# - pip install -q -r requirements.txt
|
|
||||||
# - pip install -q pytest~=8.3.5
|
|
||||||
# - python -m unittest discover tests
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# needs:
|
|
||||||
# - test
|
|
||||||
|
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG .
|
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG .
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ def init_proxy(app):
|
|||||||
title = item.find("title")
|
title = item.find("title")
|
||||||
new_title = re.sub(r'&#\d+', '', title.text)
|
new_title = re.sub(r'&#\d+', '', title.text)
|
||||||
title.text = new_title
|
title.text = new_title
|
||||||
# print(title.text)
|
|
||||||
|
|
||||||
if cached_item:
|
if cached_item:
|
||||||
cached_items.append(cached_item.decode())
|
cached_items.append(cached_item.decode())
|
||||||
@@ -99,9 +98,8 @@ def init_proxy(app):
|
|||||||
if new_guid:
|
if new_guid:
|
||||||
print(f"Заменяю GUID: {guid.text} → {new_guid}")
|
print(f"Заменяю GUID: {guid.text} → {new_guid}")
|
||||||
guid.attrib.clear()
|
guid.attrib.clear()
|
||||||
guid.text = new_guid # 🔹 Теперь подмена делается ДО нормализации
|
guid.text = new_guid
|
||||||
|
|
||||||
# 🔹 Теперь нормализуем весь item ПОСЛЕ замены guid
|
|
||||||
normalize_xml_texts(item)
|
normalize_xml_texts(item)
|
||||||
|
|
||||||
item_str = ET.tostring(item, encoding="unicode")
|
item_str = ET.tostring(item, encoding="unicode")
|
||||||
|
|||||||
Reference in New Issue
Block a user