Skip to content

Suppose Mac detected but Samsung was detected as the brand. #47

@YapWC

Description

@YapWC
Connection: keep-alive
Cache-Control: max-age=0
Sec-Ch-Ua: "Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "macOS"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9

Output at device_detector/device_detector.py under

    def device_brand(self) -> str:
        breakpoint()
        if self.skip_device_detection:
            return ''

        brand = self.all_details.get('device', {}).get('brand', '')
        if brand:
            return brand

        # Assume all devices running iOS / macOS are from Apple
        if self.os_name() in APPLE_OS_NAMES:
            return 'Apple'

        return ''

The Output

(Pdb) self.all_details
{'normalized': '', 'bot': {'name': 'Generic Bot', 'type': <DeviceType.Unknown: ''>, 'version': ''}, 'os': {'name': 'Mac', 'version': '10.15.7', 'short_name': 'MAC', 'platform': '', 'family': 'Mac'}, 'client': {'name': 'Chromium', 'version': '', 'engine': 'Blink', 'type': <AppType.Browser: 'browser'>, 'short_name': 'CR', 'family': 'chrome', 'engine_version': ''}, 'device': {'device': 'smartphone', 'brand': 'Samsung', 'type': <DeviceType.Desktop: 'desktop'>, 'model': 'Ch', 'version': ''}}

brand was labelled as Samsung.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions