json 소독

import json
import re

class LazyDecoder(json.JSONDecoder):
    def decode(self, s, **kwargs):
        regex_replacements = [
            (re.compile(r'([^\\])\\([^\\])'), r'\1\\\\\2'),
            (re.compile(r',(\s*])'), r'\1'),
        ]
        for regex, replacement in regex_replacements:
            s = regex.sub(replacement, s)
        return super().decode(s, **kwargs)

data = json.loads(response.text, cls=LazyDecoder)

print(data)

 

 

3 thoughts on “json 소독”

  1. Whinph Online Casino: Top Slots, Easy Login, Register & App Download in the Philippines Join Whinph Online Casino, the Philippines’ premier destination for gaming. Experience easy whinph login, fast whinph register, and a seamless whinph app download to play top-tier whinph slots and win big today! visit: whinph

    응답
  2. [6957]Okiebet Casino Philippines: Official Okiebet Login, Register & Download APK for the Best Okiebet Slot Online Experience. Join Okiebet Casino Philippines! Easy Okiebet login & Okiebet register for the best Okiebet slot online games. Get the Okiebet download APK & start winning today! visit: okiebet

    응답

Leave a Comment