pastabowl icon

dbusd

pastabowl | PRO | 11/05/25 08:30:02 PM UTC | 0 ⭐ | 10625 👁️ | Never ⏰ | []
Python |

3.47 KB

|

Source Code

|

0 👍

/

0 👎

from PyQt6.QtCore import QObject, QTimer, pyqtSlot as Slot
from PyQt6.QtDBus import QDBusConnection, QDBusInterface, QDBusMessage, QDBusVariant, QDBusReply
 
 
class MPRISMonitor(QObject):
    def __init__(self):
        super().__init__()
 
        self.updateTimer: QTimer = QTimer()
        self.updateTimer.timeout.connect(self.updatePosition)
 
        self.session = QDBusConnection.sessionBus()
        self.playerList: list[str] = self.getPlayers()
 
        self.playerInterface: QDBusInterface | None = None
        self.connectedService: str = ""
        if len(self.playerList) > 0:
            self.playerInterface = MPRISMonitor.getPlayerInterface(self.playerList[0])
 
            self.session.connect(
                self.connectedService,
                "/org/mpris/MediaPlayer2",
                "org.freedesktop.DBus.Properties",
                "PropertiesChanged",
                self.handlePropertiesChanged
            )
 
        self.metadata: dict = {}
        self.state: str = ""
        self.position: int = 0
 
        self.updateTimer.start(5000)
 
    def getPlayers(self) -> list[str]:
        """Return a list of all active MPRIS player service names."""
        reply = self.session.interface().registeredServiceNames()
        mediaPlayers: list[str] = []
        for s in str(reply.value()).split("\', \'"):
            if s.startswith("org.mpris.MediaPlayer2."):
                mediaPlayers.append(s)
        return mediaPlayers
 
    @staticmethod
    def getPlayerInterface(serviceName: str):
        """Get a DBus interface for a given player."""
        return QDBusInterface(
            serviceName,
            "/org/mpris/MediaPlayer2",
            "org.freedesktop.DBus.Properties",
            QDBusConnection.sessionBus()
        )
 
    def getMetadata(self):
        msg: QDBusMessage = self.playerInterface.call("Get", "org.mpris.MediaPlayer2.Player", "Metadata")
        if msg.arguments():
            self.metadata = msg.arguments()[0].variant()
 
        return self.metadata
 
    def getState(self):
        msg = self.playerInterface.call("Get", "org.mpris.MediaPlayer2.Player", "PlaybackStatus")
        if msg.arguments():
            return msg.arguments()[0].variant()
        return None
 
    def getPosition(self):
        if self.playerInterface is None: return 0
        msg = self.playerInterface.call("Get", "org.mpris.MediaPlayer2.Player", "Position")
        if type(msg.arguments()[0]) is int:
            return msg.arguments()[0] / 1000000  # µs → s
        print(type(msg.arguments()))
        return 0
 
    @Slot(QDBusMessage)
    def handlePropertiesChanged(self, msg: QDBusMessage):
        args = msg.arguments()
        if len(args) < 2:
            return
        changed = args[1]  # dict of changed properties
        if not isinstance(changed, dict):
            return
 
        if "Metadata" in changed:
            cMetadata = changed["Metadata"]
            if cMetadata != self.metadata:
                self.metadata = cMetadata
 
        if "PlaybackStatus" in changed:
            cState = changed["PlaybackStatus"]
            if cState != self.state:
                print(f"▶️  Playback state: {cState}")
                self.state = cState
 
        print("Change detected! TBI")
 
    def updatePosition(self):
        pos = self.getPosition()
        if abs(pos - self.position) > 2:
            print(f"⏱️  Position: {pos:.1f}s")
            self.position = pos

Comments

  • Venzetis icon
    03/30/26 01:51:17 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎