Repository: yt-dlp/yt-dlp

Issue:
[Gofile.io] can't download
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.04.08** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [ ] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

_No response_

### Description

hello,

i can't download from gofile.io, tried with cookies but fail too.

URL: https://gofile.io/d/cUkVvF

### Verbose log

```shell
C:\Users\Administrator>youtube-dl -UvF "https://gofile.io/d/cUkVvF"
[debug] Command-line config: ['-UvF', 'https://gofile.io/d/cUkVvF']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2022.04.08 [7884ade] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19042-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.0-full_build-www.gyan.dev (setts), ffprobe 5.0-full_build-www.gyan.dev
[debug] Optional libraries: brotli, certifi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.04.08, Current version: 2022.04.08
yt-dlp is up to date (2022.04.08)
[Gofile] Getting a new guest account
[debug] [Gofile] Extracting URL: https://gofile.io/d/cUkVvF
[download] Downloading playlist: cUkVvF
[Gofile] Gofile: Getting filelist
ERROR: Unable to download JSON metadata: HTTP Error 401: Unauthorized (caused by <HTTPError 401: 'Unauthorized'>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 767, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 3601, in urlopen
  File "urllib\request.py", line 531, in open
  File "urllib\request.py", line 640, in http_response
  File "urllib\request.py", line 569, in error
  File "urllib\request.py", line 502, in _call_chain
  File "urllib\request.py", line 649, in http_error_default
urllib.error.HTTPError: HTTP Error 401: Unauthorized

[Gofile] playlist cUkVvF: Downloading 0 videos
[download] Finished downloading playlist: cUkVvF
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/gofile.py b/yt_dlp/extractor/gofile.py
--- a/yt_dlp/extractor/gofile.py
+++ b/yt_dlp/extractor/gofile.py
@@ -19,22 +19,25 @@ class GofileIE(InfoExtractor):
                 'id': 'de571ac1-5edc-42e2-8ec2-bdac83ad4a31',
                 'filesize': 928116,
                 'ext': 'mp4',
-                'title': 'nuuh'
+                'title': 'nuuh',
+                'release_timestamp': 1638338704,
+                'release_date': '20211201',
             }
         }]
-    }, {  # URL to test mixed file types
-        'url': 'https://gofile.io/d/avt34h',
+    }, {
+        'url': 'https://gofile.io/d/is8lKr',
         'info_dict': {
-            'id': 'avt34h',
-        },
-        'playlist_mincount': 1,
-    }, {  # URL to test no video/audio error
-        'url': 'https://gofile.io/d/aB03lZ',
-        'info_dict': {
-            'id': 'aB03lZ',
+            'id': 'TMjXd9',
+            'ext': 'mp4',
         },
         'playlist_count': 0,
         'skip': 'No video/audio found at provided URL.',
+    }, {
+        'url': 'https://gofile.io/d/TMjXd9',
+        'info_dict': {
+            'id': 'TMjXd9',
+        },
+        'playlist_count': 1,
     }]
     _TOKEN = None
 
@@ -50,9 +53,11 @@ def _real_initialize(self):
         self._set_cookie('gofile.io', 'accountToken', self._TOKEN)
 
     def _entries(self, file_id):
-        files = self._download_json(
-            f'https://api.gofile.io/getContent?contentId={file_id}&token={self._TOKEN}&websiteToken=websiteToken&cache=true',
-            'Gofile', note='Getting filelist')
+        files = self._download_json('https://api.gofile.io/getContent', 'Gofile', note='Getting filelist', query={
+            'contentId': file_id,
+            'token': self._TOKEN,
+            'websiteToken': 12345,
+        })
 
         status = files['status']
         if status != 'ok':
@@ -65,7 +70,7 @@ def _entries(self, file_id):
                 continue
 
             found_files = True
-            file_url = file.get('directLink')
+            file_url = file.get('link')
             if file_url:
                 yield {
                     'id': file['id'],


Test patch: