Repository: yt-dlp/yt-dlp

Issue:
apt doesn't keep track of latest version
### Checklist

- [X] I'm asking a question and **not** reporting a bug/feature request
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar questions including closed ones

### Question

Yesterday I came online and the first thing I did was to run `sudo apt upgrade yt-dlp`. At the time I had a version 2021-12-27 or something similar. Apt then told me I had the latest version and didn't need to upgrade,

I run Linux Mint 20.3 and as it happened the gui Update Manager ran at the same time, and it told me I could upgrade to version 2022.01.21, which I did using the Upgrade Manager.

I have never before experienced the Upgrade Manager telling me about an available upgrade for yt-dlp. Perhaps this is a new interaction. In any case I appreciate it since that's the most dead-sure way of catching new upgrades and being up-to-date.

### Verbose log

_No response_


Discussion:
You should ask the people who make apt packages. They are not maintained by me (and I am not going to maintain for the dozens of PMs)
PMs?
Package managers
Ah… Yes, I keep wondering about the poor job these various products make of being up-to-date. It's terribly messy and gives all of Linux a bad reputation.
People who stream live videos to multiple platforms can use various services, I think one is called Streamyard. I wonder why someone could't come up with a similar solution for program developers to update all the PMs with one single interface.
To be fair to them, yt-dlp tends to break a lot due to external factors. So it needs frequent updates and is not really suitable for any manually maintained PMs - especially ones that don't go by rolling release models. Even so, a lot of devs do good job maintaining the packages (brew, AUR etc).

But at the end, I strongly recommend just installing through PIP or the provided release. The release binary has a self-update mechanism. So you are guarenteed to always be at the latest as long as you put a `-U` in the config. Similarly, the pip release is made automatically as part of the workflow and so is always guaranteed to be up to date
Do you know if my Update Manager (mintUpdate 5.8.1) uses PIP or was it just luck that it was updated to the latest yt-dlp release? In other words, can I rely on it telling me in the future whenever I need to upgrade? Or should I run some PIP command from the command line each time I go online to download videos (which usually doesn't happen many times per month)?
No idea
OK, but you referred to using PIP as the best way to go about staying updated. Could you give the simple command line to do the update check and upgrade with PIP? I know I have had some issue trying it in the past.
https://github.com/yt-dlp/yt-dlp#with-pip
But seeing as I already have yt-dlp installed. Wouldn't running PIP now mess up stuff?
You'll end up with both versions installed... or, you can just uninstall the other version
If I have two versions installed at the same time, which one is called when I run yt-dlp from the command line? Surely not both? How does one distinguish between them?
depends on how your PATH is set up

These questions really have nothing to do with yt-dlp and is better asked in some linux forums
OK. Thank you for being patient!

Resolving patch:
diff --git a/yt_dlp/extractor/globo.py b/yt_dlp/extractor/globo.py
--- a/yt_dlp/extractor/globo.py
+++ b/yt_dlp/extractor/globo.py
@@ -12,6 +12,7 @@
     compat_str,
 )
 from ..utils import (
+    HEADRequest,
     ExtractorError,
     float_or_none,
     orderedSet,
@@ -67,11 +68,28 @@ class GloboIE(InfoExtractor):
     }, {
         'url': 'globo:3607726',
         'only_matching': True,
+    }, {
+        'url': 'https://globoplay.globo.com/v/10248083/',
+        'info_dict': {
+            'id': '10248083',
+            'ext': 'mp4',
+            'title': 'Melhores momentos: Equador 1 x 1 Brasil pelas Eliminatórias da Copa do Mundo 2022',
+            'duration': 530.964,
+            'uploader': 'SporTV',
+            'uploader_id': '698',
+        },
+        'params': {
+            'skip_download': True,
+        },
     }]
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
 
+        self._request_webpage(
+            HEADRequest('https://globo-ab.globo.com/v2/selected-alternatives?experiments=player-isolated-experiment-02&skipImpressions=true'),
+            video_id, 'Getting cookies')
+
         video = self._download_json(
             'http://api.globovideos.com/videos/%s/playlist' % video_id,
             video_id)['videos'][0]
@@ -82,7 +100,7 @@ def _real_extract(self, url):
 
         formats = []
         security = self._download_json(
-            'https://playback.video.globo.com/v1/video-session', video_id, 'Downloading security hash for %s' % video_id,
+            'https://playback.video.globo.com/v2/video-session', video_id, 'Downloading security hash for %s' % video_id,
             headers={'content-type': 'application/json'}, data=json.dumps({
                 "player_type": "desktop",
                 "video_id": video_id,
@@ -92,7 +110,9 @@ def _real_extract(self, url):
                 "tz": "-3.0:00"
             }).encode())
 
-        security_hash = security['source']['token']
+        self._request_webpage(HEADRequest(security['sources'][0]['url_template']), video_id, 'Getting locksession cookie')
+
+        security_hash = security['sources'][0]['token']
         if not security_hash:
             message = security.get('message')
             if message:
@@ -115,7 +135,7 @@ def _real_extract(self, url):
         md5_data = (received_md5 + padded_sign_time + '0xAC10FD').encode()
         signed_md5 = base64.urlsafe_b64encode(hashlib.md5(md5_data).digest()).decode().strip('=')
         signed_hash = hash_prefix + padded_sign_time + signed_md5
-        source = security['source']['url_parts']
+        source = security['sources'][0]['url_parts']
         resource_url = source['scheme'] + '://' + source['domain'] + source['path']
         signed_url = '%s?h=%s&k=html5&a=%s' % (resource_url, signed_hash, 'F' if video.get('subscriber_only') else 'A')
 


Test patch: