Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js_to_json comment parsing is removing a comma #24721

Open
5 of 6 tasks
tiagoad opened this issue Apr 10, 2020 · 0 comments
Open
5 of 6 tasks

js_to_json comment parsing is removing a comma #24721

tiagoad opened this issue Apr 10, 2020 · 0 comments

Comments

@tiagoad
Copy link

tiagoad commented Apr 10, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.24
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Description

I have found that on the git version, in certain conditions, the js_to_json parser will remove a comma from the data, resulting in unparsable json.

This can be seen on the link https://www.rtp.pt/play/p1039/odisseia, where the JS

          id: "player_prog",
          fileKey: "/nas2.share/h264/512x384/odisseia/odisseia_1_20130120.mp4",
          file : "https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/odisseia/index.m3u8?tlm=hls&streams=odisseia_1_20130120.mp4.m3u8:1024",
                                  seekBarThumbnailsLoc: '//cdn-images.rtp.pt/multimedia/screenshots/',
                      adsType: 'dfp',
          subadUnit: 'Play',
          streamType:"ondemand",
          googleCast: true,
          //extraSettings: { googleCastReceiverAppId:'1A6F2224', skin:'s3',  skinAccentColor: '0073FF'},
          extraSettings: { googleCastReceiverAppId:'1A6F2224'},
          mediaType: "video",
          poster: "https://cdn-images.rtp.pt/EPG/imagens/29649_34099_15556.png?v=3&w=1170",
          modules: [{ name: 'RTPFavIcon', bucket: '1' }]
        }

turns into JSON

{
          "id": "player_prog",
          "fileKey": "/nas2.share/h264/512x384/odisseia/odisseia_1_20130120.mp4",
          "file" : "https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/odisseia/index.m3u8?tlm=hls&streams=odisseia_1_20130120.mp4.m3u8:1024",
                                  "seekBarThumbnailsLoc": "//cdn-images.rtp.pt/multimedia/screenshots/",
                      "adsType": "dfp",
          "subadUnit": "Play",
          "streamType":"ondemand",
          "googleCast": true

          "extraSettings": { "googleCastReceiverAppId":"1A6F2224"},
          "mediaType": "video",
          "poster": "https://cdn-images.rtp.pt/EPG/imagens/29649_34099_15556.png?v=3&w=1170",
          "modules": [{ "name": "RTPFavIcon", "bucket": "1" }]
        }

The comma after the googleCast key was removed, resulting in an error.

This is caused by this line of code:

{comment}|,(?={skip}[\]}}])|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant