Explorer
/tmp/patch_aa022_sources_yaml.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-radar/sources_multi.yaml')
s=p.read_text()
s=s.replace('''      - channel_id: UCWwWOFsiv59TtmJ7SfT-A2g   # Platzhalter -> wird bei 404 übersprungen
        name: "Beobachteter Kanal 2"
''','''      - channel_id: UCv_TmPtfMuOdETNJADiFNUQ   # Instalaciones Alcolea, verifizierter Technikkanal
        name: "Instalaciones Alcolea – Ventilación"
''',1)
anchor='''      - "Haus leerstehen Mallorca"
    # C. Produkt-/Technikthemen
'''
addition='''      - "Haus leerstehen Mallorca"
      # Fachrotation DE
      - "dezentrale Lüftung"
      - "Wohnraumlüftung"
      - "kontrollierte Wohnraumlüftung"
      - "Raumluftqualität"
      - "CO2 Innenraum"
      - "VOC Innenraum"
      - "Luftqualität Sensor"
      - "Feuchtemessung Wand"
      - "Taupunkt"
      - "Kondensation Gebäude"
      - "Wärmebrücke Kondensation"
      - "Luftwechsel"
      - "Luftmenge Lüftung"
      - "Lüftungsplanung"
      - "Schimmel Ursache Gebäude"
      - "Feuchtigkeit Gebäude"
      # Fachrotation ES
      - "ventilación mecánica"
      - "ventilación descentralizada"
      - "renovación de aire"
      - "calidad del aire interior"
      - "CO2 interior"
      - "sensores calidad aire"
      - "sensores humedad"
      - "humedad paredes"
      - "condensación vivienda"
      - "moho vivienda"
      - "diagnóstico humedad"
      - "puente térmico"
      - "caudal de aire"
      - "planificación ventilación"
      # Fachrotation EN
      - "decentralized ventilation"
      - "residential ventilation"
      - "indoor air quality"
      - "indoor CO2"
      - "VOC indoor air"
      - "ventilation monitoring"
      - "humidity sensor"
      - "moisture measurement"
      - "condensation building"
      - "thermal bridge"
      - "airflow measurement"
      - "ventilation design"
      - "mold cause building"
    # C. Produkt-/Technikthemen
'''
assert anchor in s
s=s.replace(anchor,addition,1)
s=s.replace('    searches_per_run: 4\n','    searches_per_run: 6\n',1)
old='''  facebook:
    enabled: true
'''
new='''  facebook:
    # Sauber deaktiviert: 11 Läufe ohne eine belastbare Einzelpost-URL.
    # Keine Login-/Cookie-/CAPTCHA-Umgehung; fachliche Abdeckung erfolgt über RSS/YouTube/Watch.
    enabled: false
'''
assert old in s
s=s.replace(old,new,1)
p.write_text(s)